Front page | perl.perl6.language |
Postings from March 2005
Re: s/true/better name/
Thread Previous
|
Thread Next
From:
Thomas Sandlaß
Date:
March 17, 2005 00:27
Subject:
Re: s/true/better name/
Message ID:
42393F49.8050606@orthogon.com
Larry Wall wrote:
> $x = whether $a or $b;
> $x = not $a or $b;
>
> would actually be parsed as
>
> $x = whether($a) or $b;
> $x = not($a) or $b;
>
> whereas as a native English speaker would probably expect
>
> $x = whether($a or $b);
Reading this makes me wanting:
$x = either $a or $b;
$y = neither $a nor $b;
And of course binary \ and \\ for the latter :)
> So I'm thinking we'll just go back to "true", both for that reason,
> and because it does syntactically block the naughty meaning of true as
> a term (as long as we don't default true() to $_), as Luke reminded us.
What is so bad of having a proper type bool? I mean one that gives
a type error or warning for 'answer() == true' if &answer returns Int
because bool { not .does Comparable }? This type would be rather
lightweight, compile time only with representation bit. The .bit
property would then actually become a call of 'as bool'.
Regards,
--
TSa (Thomas Sandlaß)
Thread Previous
|
Thread Next