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

Re: C<::> in rules

Thread Previous | Thread Next
From:
Larry Wall
Date:
May 13, 2005 12:26
Subject:
Re: C<::> in rules
Message ID:
20050513192635.GA19213@wall.org
On Fri, May 13, 2005 at 11:43:42AM +0300, Markus Laire wrote:
: Perhaps spec should be changed so that :p means :p(bool::true) or :p(?1) 
: and not :p(1)

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
	...
    }

Or maybe it's something more like "1 but assumed".  In any event, it'd
be nice to be able to distinguish :p from :p(1) somehow.  Maybe the
Bool type is good enough for that.  The bool type probably isn't unless
we depend on autoboxing to turn it into a Bool consistently.

Larry

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