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

Re: [Scheme-reports] Formal Comment: what is the required behavior of 'lazy'?



On Fri, Jun 29, 2012 at 9:32 AM, Eli Barzilay <eli@x> wrote:
> Yesterday, Alex Shinn wrote:
>> On Thu, Jun 28, 2012 at 1:39 AM, Eli Barzilay <eli@x> wrote:
>> > A few minutes ago, Alex Shinn wrote:
>> >> On Thu, Jun 28, 2012 at 1:12 AM, Eli Barzilay <eli@x> wrote:
>> >> > With both present, there is an easy way to remember which one to
>> >> > choose: `lazy'.
>> >>
>> >> `delay' is useful for many other things besides streams, where
>> >> `lazy' would not be applicable.
>> >
>> > For example...?
>>
>> Do you honestly doubt that the concept of delayed
>> evaluation has uses outside of a stream?
>>
>> In the most basic case it serves as a simple cache:
>>
>>   (let ((x (delay <expr>)))
>>      ...
>>      (if ... (force x) ...)
>>      ...
>>      (if ... (force x) ...))
>>
>> Lazy doesn't work here.
>
> *Some* `lazy's do.  I missed the fact that you've crippled `lazy'.
> (It's an odd decision that not only makes it a more limited tool, it also
> contradicts a dynamically typed language.)

I'm only aware of one definition of `lazy' - the one
from srfi-45 and used by srfi-41.  If there is an
alternative definition I'd like to know.

However, if there _is_ a syntax which can work as
both `lazy' and `delay', then we can just replace `delay'
with that and drop `lazy', making life once again simple
for users.

-- 
Alex

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports