develooper Front page | perl.perl5.porters | Postings from October 1999

Re: perlthread.pod -- First draft of thread docs

Dan Sugalski
October 26, 1999 04:54
Re: perlthread.pod -- First draft of thread docs
Message ID:
At 10:54 AM 10/26/99 +0200, Matthias Urlichs wrote:
>Tuomas J. Lukka:
>> Actually, I think that maybe
>> 	$lock = lock $obj;
>> 	undef $lock;
>> would make a nice interface
>That's somewhat nonintuitive, IMHO, because the current semantics of
>     foo();
>are identical to
>     {  my $bar = foo(); }
>     my $bar = foo();
>	 $bar = undef;
>so the lock code would need some internal magic to determine whether its
>return value is going to be stored anywhere.
>Somehow I doubt that the current Perl core allows for this..?

Oh, sure. Check wantarray. It's undef in void context (like a plain lock
$foo) and false in scalar context. you can do it from within the core with
a quick macro check, though I don't remember which one at the moment.

Whether we want to do that or not is a separate question. 


----------------------------------------"it's like this"-------------------
Dan Sugalski                            even samurai                           have teddy bears and even
                                        teddy bears get drunk Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About