I think you could only delay function calls automatically like this if you
could ensure that they are truely functional.  That is, their output must
depend only on the arugments given and must have no mutation
side-effects.  It seems to me that this is hard to guarantee in Perl, even
for the compiler.

"David L. Nicol" wrote:

> [EMAIL PROTECTED] wrote:
>
> > You may wish to read this thread about lazy arrays and object
> > persistence to get an idea of what you're getting into.
> > http://www.geocrawler.com/archives/3/3024/2001/3/0/5427925/
>
> Taking lazy as far as we can, has anyone been thinking about
> a compilation mode in which all expensive accesses get deferred until
> there is a decision to be made?  I know some functional languages
> (and Algol 68?) do this, when they can -- just stack up Things To Do
> until an output or a decision is required, then figure out just what
> is needed to generate or make the output/decision.  How would this work
> in perl?  We'd have to stop relying on side effects and well defined
> short-circuiting, for one -- or would we?

Reply via email to