in reply to Re: Re: Insensitive Scoundrel
in thread Insensitive Scoundrel

This seems entirely reasonable to me.

I guess the generalization of this would be for the Perl Run-time system (the Bytecode interpreter or Parrot or whatever) to recognize when a routine is being called in a void context and to propagate down to all callees to not bother assigning to or otherwise generating any data structure that is to be returned, unless that data structure is needed for other processing.

It also might simplify Perl to then define foreach in terms of map, etc.

Replies are listed 'Best First'.
Re: Re: Re: Re: Insensitive Scoundrel
by diotalevi (Canon) on Sep 28, 2002 at 17:35 UTC

    I seem to recall just this sort of optimization being discussed on one of the perl6 lists recently. So maybe you'll get it anyway. ;-)