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

Re: C<::> in rules

Thread Previous | Thread Next
From:
Damian Conway
Date:
May 13, 2005 16:53
Subject:
Re: C<::> in rules
Message ID:
42853E0C.9090201@conway.org
Larry wrote:

> I'm still not sure I believe in booleans to that extent.  I suppose
> we could go as far as to make it :p(0 but true).  Actually, it's more
> like "undef but true", if you want to be able to distinguish
> 
>     sub foo (+$p = 0) {		# no :p at all
> 	say "true" if $p;	# :p with no argument
> 	$p //= 42;		# :p with no argument
> 	...
>     }

Yes, I was thinking along the same lines. C<undef but true> as a default seems 
to be more accurate and useful than C<Bool::true>.

Damian

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