Deutsch   English   Français   Italiano  
<vcdamc$3p5os$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "B. Pym" <Nobody447095@here-nor-there.org>
Newsgroups: comp.lang.lisp,comp.lang.scheme
Subject: Re: Functional programming
Date: Wed, 18 Sep 2024 01:34:05 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <vcdamc$3p5os$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Wed, 18 Sep 2024 03:34:06 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="37c9476df3a50cad9ce61661ae32308b";
	logging-data="3970844"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19bkW7GNw8TDBHnF9FNPW9B"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:FVIap/hSYnNG6LxYAqpycrLMat4=
Bytes: 1341

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