From 48cf8f7804103672878d149279379691ec9af756 Mon Sep 17 00:00:00 2001 From: mryouse Date: Thu, 21 Jul 2022 23:59:31 +0000 Subject: deprecate with-write and list-length --- cipher/viewer.neb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cipher/viewer.neb b/cipher/viewer.neb index 1888b76..8239d79 100644 --- a/cipher/viewer.neb +++ b/cipher/viewer.neb @@ -26,10 +26,10 @@ (func save-and-exit (cipher codex) (print "in save-and-exit") - (with-write "progress.txt" - (write (concat cipher (newline)) _file_) - (for-each codex - (write (concat (first _item_) " " (first (rest _item_)) (newline)) _file_))) + (def prog (open-write "progress.txt")) + (write (concat cipher "\n") prog) + (for-each codex + (write (concat (first _item_) " " (first (rest _item_)) "\n") prog)) (exit)) (func loop (cipher codex) @@ -44,7 +44,7 @@ (branch ((eq? "quit" (first inp)) (exit)) ((eq? "save" (first inp)) (save-and-exit cipher cur)) - ((> (list-length inp) 2) (exit)) + ((> (length inp) 2) (exit)) ((and (empty? (rest inp)) (in? (first inp) (keys cur))) (redef cur (remove cur (first inp)))) ((in? (first inp) (keys codex)) -- cgit v1.2.3