develooper Front page | perl.perl6.language | Postings from March 2005

Re: [Pugs] Closing a file handle surprised the heck out of me

Thread Previous
From:
Autrijus Tang
Date:
March 15, 2005 09:29
Subject:
Re: [Pugs] Closing a file handle surprised the heck out of me
Message ID:
20050315172850.GA75992@aut.dyndns.org
On Tue, Mar 15, 2005 at 08:52:07AM -0800, Larry Wall wrote:
> : That is fine because the three thunks are registered to the fh
> : in evaluation order.  What will be more fun is if they are all
> : part of some other lazy lists, which may be accessed in some
> : unpredictable order.
> 
> You could treat seek as a synchronization point like close.

True. So maybe the trick is define such a set of synchronization
points for resources that has lazy/eager conflicts, instead of forcing
eager context on RHS of all infix:<=>, especially because most
assignments probably only involve simple COW copying, so it'd be
sad to lose the laziness benefit.

> : That is why lazy languages typically use some sort of typechecking to
> : avoid mixing computations with actions... :)
> 
> Which is also what we're doing, except that we're hiding that fact
> from the user whenever we can rather than rubbing their nose in it.  :-)

As long as surprises can be minimized (or at least explained), that's
entirely fine, I think. :)

Thanks,
/Autrijus/


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About