• Re: Help on simple LISP function

    From B. Pym@Nobody447095@here-nor-there.org to comp.lang.lisp on Mon Jun 23 08:29:59 2025
    From Newsgroup: comp.lang.lisp

    Frode Vatvedt Fjeld wrote:

    I need to write a function that accepts a list and produces a new
    list. The new list will keep the numeric, negative atoms at the top
    level and remove everything else. In addition it will increment
    these new values.

    LOOP can do this.

    (loop for x in <list> when (and (numberp x) (minusp x)) collect (1+ x))

    Gauche Scheme:

    (filter-map (every-pred number? negative? (pa$ + 1)) <list>)
    --- Synchronet 3.21d-Linux NewsLink 1.2