Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #34850

Re: What about code blocks (not Forth blocks)?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From Melzzzzz <mel@zzzzz.com>
Newsgroups comp.lang.forth
Subject Re: What about code blocks (not Forth blocks)?
Date Tue, 9 Dec 2014 05:01:48 +0100
Organization albasani.net
Lines 39
Message-ID <20141209050148.42d4f848@maxa-pc> (permalink)
References <583c56b0-8514-4e6c-a120-029bce9ad7c1@googlegroups.com> <2013Dec19.165803@mips.complang.tuwien.ac.at> <7xfvpoaf8j.fsf@ruckus.brouhaha.com> <59f8fc63-88ac-4cd0-a388-f7b487e6789c@googlegroups.com> <lfm7aq$9o5$1@dont-email.me> <m65rqg$puc$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net 748W4ZTXxVTlhAAU38RPd0S6p18GRqFDhgypr/6PZ+Q6zWDR9jKTADh7LnOwoQrq5HmtxGgRaJz2QaevBAqPGg==
NNTP-Posting-Date Tue, 9 Dec 2014 04:01:48 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="SQTOyx4kKlnTEHp1wbhfiM0J/96QKudmqnPAbP0T6kFVPB2K6Xxwt8MrbU09tBUwn4xfNfynjny95PVGil5+CvJ1y9FVrVxUpa5qMzAdMs8LsDQ/x5gi730tS+U2mx+l"; mail-complaints-to="abuse@albasani.net"
X-Newsreader Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-unknown-linux-gnu)
Cancel-Lock sha1:YX/s1TvmTHDhaWzvERdHzUKKe5o=
Xref csiph.com comp.lang.forth:34850

Show key headers only | View raw


On Tue, 9 Dec 2014 03:54:57 +0000 (UTC)
"WJ" <w_a_x_man@yahoo.com> wrote:

> WJ wrote:
> 
> > hughaguilar96@yahoo.com wrote:
> > 
> > > I said that, to be useful, the quotation needs to have access
> > > to the creator function's local variables. The idea is that
> > > you have a word (like EACH in my novice package) that
> > > traverses a data-structure. It is given the xt of a quotation,
> > > and it EXECUTEs this xt for every node in the data-structure,
> > > giving the quotation that node's address as a parameter. The
> > > quotation needs to have access to the creator function's local
> > > variables so that it can communicate back information that it
> > > obtains from the data-structure nodes.
> > > 
> > > Bernd Payson kicked me off the Forth-200x mailing list for saying
> > > this.
> > 
> > Tyranny.
> 
> Gauche Scheme:
> 
> ;; The lambda is the "quotation".
> 
> (let ((sum 0.0) (multiplier 400))
>   (for-each
>     (lambda (x)
>       (when (number? x)
>         (inc! sum (* x multiplier))))
>     '(a 2 3 f 5 g))
>   sum)
> 
>  ===>
> 4000.0
> 

Gosh, I never liked excessive parenthesis ;)

Back to comp.lang.forth | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: What about code blocks (not Forth blocks)? "WJ" <w_a_x_man@yahoo.com> - 2014-12-09 03:54 +0000
  Re: What about code blocks (not Forth blocks)? Melzzzzz <mel@zzzzz.com> - 2014-12-09 05:01 +0100

csiph-web