2 ms·
There is always this alternative: don't have any variables to name! (defun print-first-n-pos (n seq) [(opip (take n) (keep-if [orf zerop plusp
by kazinator 11y ago
There is always this alternative: don't have any variables to name!
(defun print-first-n-pos (n seq)
[(opip (take n)
(keep-if [orf zerop plusp])
(progn
(mapdo (op put-string `@1 `) @1)
(put-line)
@1)
(- n (length @1)))
seq])
$ txr -i first-n-pos.tl
1> (print-first-n-pos 4 '(-1 2 3 4 5 6))
2 3 4
1
2> (print-first-n-pos 5 '(-1 -2 3 4 -5 6))
3 4
3
Well, @1 is technically a variable. :)