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

Re: C<::> in rules

Thread Previous | Thread Next
Damian Conway
May 13, 2005 16:53
Re: C<::> in rules
Message ID:
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>.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About