• Re: (iota N) in Spice Lisp idiom

    From Lawrence D'Oliveiro@21:1/5 to HenHanna on Tue Feb 27 23:13:35 2024
    XPost: comp.lang.lisp

    On Tue, 27 Feb 2024 14:56:39 -0800, HenHanna wrote:

    They almost-always used this idiom of Push, Push, ... Nreverse.

    Neither are available in Guile, that I can see.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B. Pym@21:1/5 to Kaz Kylheku on Sun May 26 08:32:07 2024
    XPost: comp.lang.lisp

    On 2/27/2024, Kaz Kylheku wrote:

    Common Lisp's loop macro has a collect{ing} clause.

    (defun iota (n)
    (loop for i from i to n
    collect n))


    Incorrect; three errors.

    Correct:

    (defun iota (n)
    (loop for i from 0 below n
    collect i))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)