2 ms·
> Similarly, Štar doesn’t contain a mass of syntax letting you select only certain values, or allowing you to terminate iteration early: you don’t write > (loo
by andsoitis 3y ago
> Similarly, Štar doesn’t contain a mass of syntax letting you select only certain values, or allowing you to terminate iteration early: you don’t write
> (loop for x in l while (numberp x) do ...)
> Instead you write
> (for ((x (in-list l)))
> (unless (numberp x) (final))
> ...)
While loop has arcane grammar and can be hard to write correctly, it will be read many more times and so I think is preferable to the latter.
- lispm 3y agoFor a Lisp user the s-expression variant would be more useful, because it is easier to write and read. It also helps that it is easier to indent / pretty print, because the usual pretty printer algorithms can be used. For LOOP one would need an indent / pretty printer with either some heuristics and/or knowledge of LOOP grammar. Personally I use LOOP because it is built in. But generally I prefer something like ITERATE, which is similar powerful but fits better into the host language (-> Common Lisp).
- andsoitis 3y agoI, too, am lisperati :-)