• CAR/CDR vs FIRST/REST

    From Robert L.@21:1/5 to All on Thu Feb 10 04:13:43 2022
    (mapcan #'(lambda (x) (and (numberp x) (list x))) list)

    (loop for x in list
    when (numberp x) collect x)

    I agree with this example. Once I learned LOOP I never used the
    above idiom again.


    (filter number? '(a b c 1 2 3))

    (1 2 3)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Zyni=20Mo=C3=AB?=@21:1/5 to Robert L. on Thu Feb 10 21:53:20 2022
    Robert L. <No_spamming@noWhere_7073.org> wrote:

    [noise]

    Wow, the quoted text in this post seems to be from 1994. Trolls gonna
    troll, I suppose.


    --
    the small snake

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to no_email@invalid.invalid on Fri Feb 11 02:39:20 2022
    no_email@invalid.invalid writes:
    Robert L. <No_spamming@noWhere_7073.org> wrote:
    [noise]
    Wow, the quoted text in this post seems to be from 1994. Trolls gonna
    troll, I suppose.

    Comments on LISP are not noise in comp.lang.lisp.
    Answering an old post is not trolling.

    What's the noise-to-LISP ratio of /your/ comment
    quoted above?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Zyni=20Mo=C3=AB?=@21:1/5 to Stefan Ram on Fri Feb 11 09:41:25 2022
    Stefan Ram <ram@zedat.fu-berlin.de> wrote:

    Comments on LISP are not noise in comp.lang.lisp.
    Answering an old post is not trolling.


    Perhaps unlike you I remember the person who systematically did exactly
    this thing in exactly this way, with exactly this aim of systematically denigrating CL (notice their 'Instead of CL, let's use a Lisp' comment?)
    in, I think, late 2000s, I think perhaps because someone in the CL
    community had been nasty to them. That time I think their chosen language
    was Ruby? That person helped destroy cll, as was very clearly their aim.
    It looks as if they have woken from their narcotic slumber and are now busy trying to make sure cll stays dead. Clearly they were then and are now not well in their minds, but also clearly they were, and are, a troll.

    --
    the small snake

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B. Pym@21:1/5 to Barry Margolin on Tue Jul 2 21:33:23 2024
    Barry Margolin wrote:

    (mapcan #'(lambda (x) (and (numberp x) (list x))) list)

    (loop for x in list
    when (numberp x) collect x)

    I agree with this example. Once I learned LOOP I never used the
    above idiom again.


    (filter number? '(a b c 1 2 3))

    (1 2 3)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to B. Pym on Tue Jul 2 22:58:00 2024
    On 2024-07-02, B. Pym <No_spamming@noWhere_7073.org> wrote:
    Barry Margolin wrote:

    (mapcan #'(lambda (x) (and (numberp x) (list x))) list)

    (loop for x in list
    when (numberp x) collect x)

    I agree with this example. Once I learned LOOP I never used the
    above idiom again.


    (filter number? '(a b c 1 2 3))

    (1 2 3)

    In Common Lisp, filter has a funny name: remove-if-not.

    (remove-if-not #'numberp '(a b c 1 2 3))
    -->
    (1 2 3)

    Likely because of the funny name, the function is marked deprecated,
    which is silly.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B. Pym@21:1/5 to Barry Margolin on Thu Sep 12 17:59:57 2024
    Barry Margolin wrote:

    (mapcan #'(lambda (x) (and (numberp x) (list x))) list)

    (loop for x in list
    when (numberp x) collect x)

    I agree with this example. Once I learned LOOP I never used the
    above idiom again.


    (filter number? '(a b c 1 2 3))

    (1 2 3)

    Does using "loop" cripple the brain, or do only those
    with crippled brains use "loop"?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to B. Pym on Fri Sep 13 00:47:57 2024
    On 2024-09-12, B. Pym <Nobody447095@here-nor-there.org> wrote:
    Barry Margolin wrote:

    (mapcan #'(lambda (x) (and (numberp x) (list x))) list)

    (loop for x in list
    when (numberp x) collect x)

    I agree with this example. Once I learned LOOP I never used the
    above idiom again.


    (filter number? '(a b c 1 2 3))

    (1 2 3)

    Also, once you realize that "remove-if-not" is "keep-if":

    (remove-if-not #'numberp list)

    then you also will not use the poor "idiom":

    (mapcan #'(lambda (x) (and (numberp x) (list x))) list)

    Not to mention that once you learn that (lambda ...) is
    a macro which writes #'(lambda ...) for you, you will tend
    not to use the latter again.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca

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