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)?

From Melzzzzz <mel@zzzzz.com>
Newsgroups comp.lang.forth
Subject Re: What about code blocks (not Forth blocks)?
Date 2014-12-09 05:01 +0100
Organization albasani.net
Message-ID <20141209050148.42d4f848@maxa-pc> (permalink)
References (1 earlier) <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>

Show all headers | 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