Re: [stack] Re: Barebone implementation of concatenative language in c or c++

John Cowan <[email protected]> Wed, 21 Jul 2010 09:48:07 -0400
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
John Nowak scripsit:

> In an eager language without first-class functions, the language
> implementor can offer a special 'delay' form that creates a thunk
> at runtime. A 'force' function can later force the computation to
> occur. Since the only real semantic issue with introducing 'delay'
> is due to strictness (e.g. 'delay (4 / 0)' would not cause an error
> until forced even though '4 / 0' does immediately), it's a relatively
> uncomplicated addition from a theoretical perspective.

Note, however, that delay and force don't play well with tail recursion:
see SRFI 45 <http://srfi.schemers.org/srfi-45/srfi-45.html> for a
proposed resolution.

-- 
If I read "upcoming" in [the newspaper]              John Cowan
once more, I will be downcoming                      http://www.ccil.org/~cowan
and somebody will be outgoing.                       [email protected]