On Fri, Jul 03, 2009 at 09:40:12AM +0200, TSa wrote:
> I see. But I wouldn't make that an exception but ^^ returns a tristate
> value instead of boolean. The third state besides True and False is
> TooMany that evaluates to False in boolean context. But ^^ can react
> to it as you describe. That so
HaloO,
Martin D Kealey wrote:
Assuming you meant "^^" rather than "&&", then under my proposal, that's not
the case.
Of course! Silly me, sorry.
In particular, True ^^ True evaluates to TooManyException. If that exception
is implicitly thrown, then that's what you get from the whole express
On Thu, 2 Jul 2009, TSa wrote:
> Martin D Kealey wrote:
> > This solves both the human expectation ("Would you like wine or beer or
> > juice?" "Beer and juice please" "Sorry...") and the associativity
> > problem: (a ^^ b) ^^ (c ^^ d) == a ^^ (b ^^ (c ^^ d)).
>
> I don't understand how the associ
On Thu, Jul 2, 2009 at 9:01 AM, yary wrote:
> On Thu, Jul 2, 2009 at 8:58 AM, TSa wrote:
>>... unless list associative operators somehow flatten the
>> parens away and therefore see a single list of three values instead of
>> two consecutive lists of two items.
>
> that's exactly what list associat
On Thu, Jul 2, 2009 at 8:58 AM, TSa wrote:
>... unless list associative operators somehow flatten the
> parens away and therefore see a single list of three values instead of
> two consecutive lists of two items.
that's exactly what list associative does, it feeds an arbitrarily
long list of value
HaloO,
Martin D Kealey wrote:
This solves both the human expectation ("Would you like wine or beer or
juice?" "Beer and juice please" "Sorry...") and the associativity
problem: (a ^^ b) ^^ (c ^^ d) == a ^^ (b ^^ (c ^^ d)).
I don't understand how the associativity problem is solved when we
use
On Thu, Jun 25, 2009 at 02:47:55PM +1000, Timothy S. Nelson wrote:
> What would happen if we had an operator that returned the number of
> true values? Say we call it "boolean plus", or "bop".
...why an operator?
sub bop(*...@values) { + grep { $_ }, @values }
> To give one exa
I'm just thinking out loud in this e-mail, trying to generate
alternatives.
What would happen if we had an operator that returned the number of
true values? Say we call it "boolean plus", or "bop".
To give one example: 1 bop 3 = 2
Say we're looking at: ($x > 1) bop 3 bop (
On Wed, Jun 24, 2009 at 10:35, John Macdonald wrote:
> Which means that short-circuiting is not right here - it must
> go through the entire list to determine whether there are zero
> true selections, find the first of exactly one true selections,
> or die if there are more than one true selection
On Wed, Jun 24, 2009 at 11:10:39AM -0700, Jon Lang wrote:
> On Wed, Jun 24, 2009 at 10:35 AM, John Macdonald wrote:
> > On Tue, Jun 23, 2009 at 07:51:45AM +1000, Damian Conway wrote:
> >> Perl 6's approach to xor is consistent with the linguistic sense of
> >> 'xor' ("You may have a soup (x)or a sa
On Wed, Jun 24, 2009 at 10:35 AM, John Macdonald wrote:
> On Tue, Jun 23, 2009 at 07:51:45AM +1000, Damian Conway wrote:
>> Perl 6's approach to xor is consistent with the linguistic sense of
>> 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), [ ... ]
>
> That choice tends to mean "exa
On Wed, Jun 24, 2009 at 01:35:25PM -0400, John Macdonald wrote:
> On Tue, Jun 23, 2009 at 07:51:45AM +1000, Damian Conway wrote:
> > Perl 6's approach to xor is consistent with the linguistic sense of
> > 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), [ ... ]
>
> That choice tends t
On Tue, Jun 23, 2009 at 07:51:45AM +1000, Damian Conway wrote:
> Perl 6's approach to xor is consistent with the linguistic sense of
> 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), [ ... ]
That choice tends to mean "exactly one", rather than "the first one
the waiter hears". (A go
On Jun 22, 2009, at 19:12 , Minimiscience wrote:
On Jun 22, 2009, at 5:51 PM, Damian Conway wrote:
Perl 6's approach to xor is consistent with the linguistic sense of
'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and
also
with the IEEE 91 standard for logic gates.
I don't th
Take a look at the page to which Damian provided a link. You'll find
that XOR does indeed correspond to the definition being used by Perl
6, as well as the natural language meaning. What other languages call
XOR is actually an "odd parity check".
As I suggested above, I think that Perl 6 already
Mark J. Reed wrote:
All of which is just by way of agreeing with Jon: formal logic is not
the primary motivator behind Perl's design. So while it should be
considered, it's not a knockout punch to say "but logic doesn't work
that way."
I think another thing to consider is a survey of the variou
> On Mon, Jun 22, 2009 at 4:12 PM, Minimiscience wrote:
> I don't think natural language -- especially the abomination that is English
> -- is the best guide for understanding logical operations (why, yes, I *do*
> speak Lojban; how did you know?).
To which Jon Lang replied:
> You're aware that Pe
On Mon, Jun 22, 2009 at 4:12 PM, Minimiscience wrote:
> On Jun 22, 2009, at 5:51 PM, Damian Conway wrote:
>>
>> Perl 6's approach to xor is consistent with the linguistic sense of
>> 'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also
>> with the IEEE 91 standard for logic gates.
On Jun 22, 2009, at 5:51 PM, Damian Conway wrote:
Perl 6's approach to xor is consistent with the linguistic sense of
'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also
with the IEEE 91 standard for logic gates.
I don't think natural language -- especially the abomination th
Damian Conway wrote:
Perl 6's approach to xor is consistent with the linguistic sense of
'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also
with the IEEE 91 standard for logic gates. See:
http://ozark.hendrix.edu/~burch/logisim/docs/2.1.0/libs/gates/xor.html
for a concis
Perl 6's approach to xor is consistent with the linguistic sense of
'xor' ("You may have a soup (x)or a salad (x)or a cocktail"), and also
with the IEEE 91 standard for logic gates. See:
http://ozark.hendrix.edu/~burch/logisim/docs/2.1.0/libs/gates/xor.html
for a concise explanation of both t
I had a bit of a problem when first encountering xor with more than
two operands as well. It made sense after I thought about it
linguistically instead of mathematically. When speaking people often
use a string of "or"s to mean "pick one and only one of these choices,
the the exclusion of all other
S03 describes ^^ as a "short‐circuit exclusive‐or" operator which
returns true if & only if exactly one operand is true, short
circuiting after encountering two true values. However, this
definition is only consistent with the mathematical definition of XOR
when the operation is being perf
23 matches
Mail list logo