• Re: Functional programming

    From B. Pym@Nobody447095@here-nor-there.org to comp.lang.lisp,comp.lang.scheme on Wed Sep 18 01:34:05 2024
    From Newsgroup: comp.lang.scheme

    Erik Naggum wrote:

    I also happen to do (apply #'funcall <list>) at times. I guess Scheme's
    (apply (eval (car list)) (cdr list)) is much more _elegant_. hee hee!


    (define seq (list + 2 3 4))

    (apply (car seq) (cdr seq))


    9


    Gauche Scheme:

    (define seq (list + 2 3 4))

    ((apply pa$ seq))
    ===>
    9

    (eval seq #f)
    ===>
    9


    Racket:

    (define seq (list + 2 3 4))

    ((apply curry seq))
    ===>
    9

    (eval seq)
    ===>
    9
    --- Synchronet 3.22a-Linux NewsLink 1.2