| Put this into a file: (prn "SPAM")
nil
(prn "This won't even be loaded")
and load the file. Only SPAM is printed, because load stops after encountering a nil or (). I think this is wrong, unobvious and may lead to bugs when loading/saving generated code.
To fix this, the expression (whilet e (read f)
(eval e))
in arc.arc (Arc2, looks a bit different on anarki) should be replaced by (w/uniq eof
(whiler e (read f eof) eof
(eval e)))
And the whiler macro should be implemented as (mac whiler (var snarfdata stopval . body)
(w/uniq stop
`(withs (,var nil ,stop (testify ,stopval))
(while (no (,stop (= ,var ,snarfdata)))
,@body))))
because the current implementation also stops on nil, contrary to what the comment ; For the common C idiom while (x = snarfdata) != stopval.
by PG implies. |