picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 1d35016664022f858adb7276d92b5a7a59d5eaed
parent 8fc3f891ad968053a357fcdcdc9be11e4e225789
Author: Alexander Burger <abu@software-lab.de>
Date:   Thu, 30 May 2013 14:40:41 +0200

'+Swap' relation prefix class
Diffstat:
MCHANGES | 1+
Mapp/er.l | 4++--
Mapp/user.l | 6+++---
Mdoc/ref.html | 1+
Mdoc/refS.html | 11+++++++++++
Mersatz/picolisp.jar | 0
Mlib/adm.l | 6+++---
Mlib/db.l | 22+++++++++++++++++++++-
Msrc/vers.h | 2+-
Msrc64/version.l | 4++--
10 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/CHANGES b/CHANGES @@ -1,4 +1,5 @@ * DDjun13 picoLisp-3.1.3 + '+Swap' relation prefix class Allow unlimited number of coroutines Default coroutine stack segment size 1 MB JavaScript canvas library diff --git a/app/er.l b/app/er.l @@ -1,4 +1,4 @@ -# 04mar13abu +# 30may13abu # (c) Software Lab. Alexander Burger ### Entity/Relations ### @@ -151,7 +151,7 @@ # Database sizes (dbs - (3 +Role +User +Sal) # 512 Prevalent objects + (3 +Role +User +Sal (+User pw)) # 512 Prevalent objects (0 +Pos) # A:64 Tiny objects (1 +Item +Ord) # B:128 Small objects (2 +CuSu) # C:256 Normal objects diff --git a/app/user.l b/app/user.l @@ -1,4 +1,4 @@ -# 28may13abu +# 30may13abu # (c) Software Lab. Alexander Burger (must "User Administration" UserAdmin) @@ -14,8 +14,8 @@ '((V) (and V "****")) '((V) (if (= V "****") - (: home obj pw) - (passwd V (: home obj pw)) ) ) + (: home obj pw 0) + (passwd V (: home obj pw 0)) ) ) 30 ) ,"Role" (gui '(+Able +E/R +Obj +TextField) diff --git a/doc/ref.html b/doc/ref.html @@ -2410,6 +2410,7 @@ abbreviations: <a href="refN.html#+Need">+Need</a> <a href="refM.html#+Mis">+Mis</a> <a href="refA.html#+Alt">+Alt</a> + <a href="refS.html#+Swap">+Swap</a> <a href="refE.html#+Entity">+Entity</a> <a href="refB.html#blob">blob</a> <a href="refD.html#dbSync">dbSync</a> diff --git a/doc/refS.html b/doc/refS.html @@ -88,6 +88,17 @@ href="ref.html#dbase">Database</a>. (rel nm (+Sn +Idx +String)) # Name, indexed by soundex and substrings </code></pre> +<dt><a name="+Swap"><code>+Swap</code></a> +<dd>Prefix class for <code><a href="refR.html#+relation">+relation</a></code>s +where the data are to be stored in the value of a separate external symbol +instead of the relation's object. Typically used for data which are relatively +large and/or rarely accessed. See also <a href="ref.html#dbase">Database</a>. + +<pre><code> +(rel pw (+Swap +String)) # Password +(rel nr (+Swap +List +Number)) # List of bignums +</code></pre> + <dt><a name="+Symbol"><code>+Symbol</code></a> <dd>Class for symbolic relations, a subclass of <code><a href="refR.html#+relation">+relation</a></code>. Objects of that class typically diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/lib/adm.l b/lib/adm.l @@ -1,9 +1,9 @@ -# 28may13abu +# 30may13abu # (c) Software Lab. Alexander Burger # *Salt *Login *Users *Perms -# crypt(3) algorithm, e.g. (de *Salt 16 . "$6$@1$") +# crypt(3) algorithm, e.g. (setq *Salt (16 . "$6$@1$")) (de passwd (Str Salt) (if *Salt `(if (== 64 64) @@ -78,7 +78,7 @@ (class +User +Entity) (rel nm (+Need +Key +String)) # User name -(rel pw (+Symbol)) # Password +(rel pw (+Swap +String)) # Password (rel role (+Joint) usr (+Role)) # User role diff --git a/lib/db.l b/lib/db.l @@ -1,4 +1,4 @@ -# 03mar13abu +# 30may13abu # (c) Software Lab. Alexander Burger # *Dbs *Jnl *Blob upd @@ -829,6 +829,26 @@ (=: cls (car Lst)) ) +(class +Swap) +# dbf + +(dm has> (Val X) + (or (extra Val X) (extra Val (val X))) ) + +(dm put> (Obj Old New) + (prog1 + (or + (ext? (get Obj (: var))) + (new (or (: dbf 1) 1)) ) + (set @ (extra Obj (val Old) New)) ) ) + +(dm del> (Obj Old Val) + (ifn (ext? (get Obj (: var))) + (extra Obj Old Val) + (set @ (extra Obj (val Old) Val)) + @ ) ) + + ### Entities ### (class +Entity) diff --git a/src/vers.h b/src/vers.h @@ -1 +1 @@ -static byte Version[4] = {3,1,2,10}; +static byte Version[4] = {3,1,2,11}; diff --git a/src64/version.l b/src64/version.l @@ -1,6 +1,6 @@ -# 25may13abu +# 30may13abu # (c) Software Lab. Alexander Burger -(de *Version 3 1 2 10) +(de *Version 3 1 2 11) # vi:et:ts=3:sw=3