guile-devel
[Top][All Lists]
Advanced

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

Re: Record type printers for SRFI 45 promises and SRFI 41 streams


From: Mark H Weaver
Subject: Re: Record type printers for SRFI 45 promises and SRFI 41 streams
Date: Mon, 08 Apr 2013 15:31:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi Daniel,

Daniel Hartwig <address@hidden> writes:
> I dont see much value in distinguishing between eager and lazy,
> particularly as this leads to an unusual display format.  What
> difference does it make how the object was constructed?

It doesn't, and I agree that it's confusing.  In the SRFI-45
implementation, 'eager' means "computed", and 'lazy' means "not yet
computed".  These internal meanings are distinct from the 'lazy' and
'eager' exported to users.

> Also, this is not avoiding "#<procedure" as suggested?  A simple
> "#<promise OBJECT-ADDRESS>" is succinct and sufficient.

Sorry for flip-flopping on this, but I realized that there's an
advantage to printing the full procedure, namely that it includes the
source location of the associated (delay ...) expression.

> To distinguish from core promises a more explicit tag is preferable,
> like srfi-69 uses:
> 
> #<srfi-45:promise OBJ-ADDR>

We later discussed this on IRC, but for those who weren't present:

The problem with this idea is that there's likely to be another new SRFI
that's almost identical to SRFI-45 but with 'eager' as a macro instead
of a procedure, so that it can accept a single expression that yields
multiple values.

We'll want to use the same underlying type to support both SRFIs, at
which point this idea of printing the SRFI number in the tag breaks
down.

      Regards,
        Mark



reply via email to

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