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 85c6f73d659ab49ee6bb5f934832995c70ada207
parent 335ae934a86677fe8872a95f2191c370de6db70e
Author: Alexander Burger <abu@software-lab.de>
Date:   Sat, 13 Jul 2013 10:03:47 +0200

'snapshot' 1-based
Diffstat:
Mlib/too.l | 17+++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/lib/too.l b/lib/too.l @@ -3,20 +3,17 @@ ### Local Backup ### (de snapshot (Dst Max . @) - (let I -1 - (while (info (pack Dst '/ (inc 'I)))) - (while (>= (dec 'I) Max) - (call 'rm "-rf" (pack Dst '/ I)) ) - (while (ge0 I) - (call 'mv (pack Dst '/ I) (pack Dst '/ (inc I))) - (dec 'I) ) ) - (when (call 'mkdir (pack Dst "/0")) + (for N (flip (sort (mapcar format (dir Dst)))) + (if (> N Max) + (call 'rm "-rf" (pack Dst '/ N)) + (call 'mv (pack Dst '/ N) (pack Dst '/ (inc N))) ) ) + (when (call 'mkdir (pack Dst "/1")) (while (args) (let (Lst (filter bool (split (chop (next)) '/)) Src (car Lst) - Old (pack Dst "/1/" Src) - New (pack Dst "/0/" Src) ) + Old (pack Dst "/2/" Src) + New (pack Dst "/1/" Src) ) (recur (Lst Src Old New) (ifn (cdr Lst) (recur (Src Old New)