• Re: Help on simple LISP function

    From B. Pym@21:1/5 to Frode Vatvedt Fjeld on Mon Jun 23 08:29:59 2025
    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>)

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