[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delay and force

From: Linus Björnstam
Subject: Re: delay and force
Date: Thu, 10 Jun 2021 07:30:15 +0200
User-agent: Cyrus-JMAP/3.5.0-alpha0-519-g27a961944e-fm-20210531.001-g27a96194

You can see a version of them used in srfi-41. I do believe I use them in my 
old implementation of rackets for loops for guile. For/foldr I used them as a 
way to ensure that the next iteration was evaluated only once (despite being 
possible to call it several times) to avoid quadratic behaviour. 

I don't really think they are used that often, since when you need laziness you 
would probably reach for srfi-41 (which is horribly slow) or generators 

I see them as a primitive mostly for macro writers, to be honest. It is useful 
if you want to handle a computation back to the user but want to make sure it 
is run at most one time. That is mostly how I have seen them used (and used 
them myself), at least. 

  Linus Björnstam

On Thu, 10 Jun 2021, at 07:08, Tim Meehan wrote:
> Are there any good examples of "medium-sized" programs that use delay and
> force? I have seen the documentation examples, but I am curious about how
> it is used by other people in larger projects.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]