develooper Front page | perl.perl6.language | Postings from May 2001

Re: 'is' and action at a distance

Thread Previous | Thread Next
From:
Graham Barr
Date:
May 18, 2001 06:53
Subject:
Re: 'is' and action at a distance
Message ID:
20010518145203.S22335@pobox.com
On Fri, May 18, 2001 at 08:31:21AM -0500, Jarkko Hietaniemi wrote:
> On Fri, May 18, 2001 at 06:22:10AM -0700, Austin Hastings wrote:
> > 
> > --- Damian Conway <damian@mail.csse.monash.edu.au> wrote:
> >  
> > > It's probably just a matter of coding what you actually mean. 
> > > In Perl 5 and 6 your version means "if $fh is true in *any* 
> > > possible way...", whereas you seem to want "if $fh is defined",
> > > which is:
> > 
> > Hmm. I can easily see this producing incomprehensible code when spread
> > across large systems. To wit, those developers used to "0 means false"
> 
> Any feature is incomprehensible if one is not used to it.  Pointers
> in C are incomprehensible if one has never met the concept before.

Right, consider overloading.

> As far as I understand one rationale behind the "false (in Perl 5 terms)
> but true (in Perl 6 terms)" is that you can write code like this
> 
> 	if ($retval = func(@args)) {
> 		# it worked ...

Right. Which of course can be done in Perl 5 with either "0 but true" (or "0E0")
or if the value is an object, the use of overloading.

Graham.


Thread Previous | Thread Next


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