--- Greg Woodhouse <[EMAIL PROTECTED]> wrote:

> I don't mean to usurp the thread here, but this is of particular
> interest to me because the techcnique I'm considering for
> implementing
> indirection in the interpreter/compiler I'm working on is to treat it
> as a call to a thunk...

BTW, hee's a simple example of how this might work in Scheme

> (define x 0)
> (define f (+ x 1))
> (define g (delay (+ x 1)))
> (set! x 7)
> f
1
> (force g)
8

When f is defined, x is evaluated right away (call by value), but g is
a thunk representing a "promise" to evaluate the expression when
forced. Notice that when I force g, I get 8 (because x has been set to
7). The MUMPS equivalent might be

>S X=0
>S F=X+1
>W F  1
>S X=7
>S G="X+1"  <=== a thunk
>W @G
8

===
Gregory Woodhouse  <[EMAIL PROTECTED]>
"All truth passes through three stages: First, it is ridiculed.
Second, it is violently opposed. Third, it is accepted as
being self-evident."
--Arthur Schopenhauer


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to