Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #34849 > unrolled thread
| Started by | "WJ" <w_a_x_man@yahoo.com> |
|---|---|
| First post | 2014-12-09 03:54 +0000 |
| Last post | 2014-12-09 05:01 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.forth
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
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
| From | "WJ" <w_a_x_man@yahoo.com> |
|---|---|
| Date | 2014-12-09 03:54 +0000 |
| Subject | Re: What about code blocks (not Forth blocks)? |
| Message-ID | <m65rqg$puc$1@dont-email.me> |
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
[toc] | [next] | [standalone]
| From | Melzzzzz <mel@zzzzz.com> |
|---|---|
| Date | 2014-12-09 05:01 +0100 |
| Message-ID | <20141209050148.42d4f848@maxa-pc> |
| In reply to | #34849 |
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 ;)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.forth
csiph-web