develooper Front page | perl.perl6.language.flow | Postings from September 2000

Re: The distinction between "do BLOCK while COND" and "EXPR while COND" should go

From:
Chaim Frenkel
Date:
September 1, 2000 11:39
Subject:
Re: The distinction between "do BLOCK while COND" and "EXPR while COND" should go
Message ID:
m3ya1cgdnf.fsf@csamnycln01.nyc.csam.com
>>>>> "TC" == Tom Christiansen <tchrist@chthon.perl.com> writes:

TC> Well, that depends.  Often you must delay till run-time.  When Perl
TC> simply sees something like:
TC>     sub fn { return @blah } 
TC> it can't know whether you'll use that as:
TC>     $x = fn();
TC> or
TC>     @x = fn();
TC> or
TC>     fn();

I think with the -internals idea of pushing a thingee on the stack
rather than flattening the list, the actual effect of the assingment
can easily be delayed with little cost to runtime.

Though Randal will jump all over me. It might be worthwhile enough
to kill
	sub fn { return (7,8,9,10) }

	$x = fn();	# $x == 10

<chaim>
-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
chaimf@pobox.com				               +1-718-236-0183



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