From 3e79cce47623855ab2025c29154e828e2007adbf Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 3 Dec 2022 09:51:59 +0200 Subject: [2022/template] Added comment explaining first line, changed cal to inpt, changed equals to string= --- 2022/template.cl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/2022/template.cl b/2022/template.cl index 9ffb4a0..285e5b5 100644 --- a/2022/template.cl +++ b/2022/template.cl @@ -1,15 +1,19 @@ (defvar *prog-input*) +;;; After running file, if you enter a blank line, code will work on each +;;; line of input, until "end" is typed. +;;; Otherwise, the input is taken as a filename and code will be executed +;;; over each line in the file until EOF. (let ((ui (read-line))) (if (equal ui "") (setq *prog-input* *standard-input*) (setq *prog-input* (open ui)))) (let - ((cal (read-line *prog-input* NIL)) ) + ((inpt (read-line *prog-input* NIL)) ) - (loop until (or (equal cal "end") (not cal)) do - (setq cal (read-line *prog-input* NIL))) + (loop until (or (string= inpt "end") (not inpt)) do + (setq inpt (read-line *prog-input* NIL))) (print 1)) -- cgit v1.2.3