Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Patrick R. Michaud
On Sat, Dec 11, 2004 at 04:42:54AM +0100, Leopold Toetsch wrote: > Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > > > Just as C returns its first non-false argument, the interpretation > > of C would be that it returns its single non-false argument, or 1 if > > both (all?) arguments logically eva

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Leopold Toetsch
Patrick R. Michaud <[EMAIL PROTECTED]> wrote: > Just as C returns its first non-false argument, the interpretation > of C would be that it returns its single non-false argument, or 1 if > both (all?) arguments logically evaluate to false. Yep, except *0* if both evaluate to either true or false.

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Luke Palmer
Sam Ruby writes: > Mike Guy wrote: > > > >Perl5 C always returns a "standard" boolean value, i.e. > >dualvar(0, '') or dualvar(1, '1').Perl6/Parrot should do the same > >thing. > > Try: > > perl -le "print 'day' xor 'night'" > > On the version of Perl I have installed, I get "day" as the

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Paul Johnson
On Fri, Dec 10, 2004 at 01:28:10PM -0500, Sam Ruby wrote: > Mike Guy wrote: > > > >Perl5 C always returns a "standard" boolean value, i.e. > >dualvar(0, '') or dualvar(1, '1').Perl6/Parrot should do the same > >thing. > > Try: > > perl -le "print 'day' xor 'night'" > > On the version of

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Luke Palmer
[ From p6i ] Patrick R. Michaud writes: > On Fri, Dec 10, 2004 at 08:50:46PM +0100, Leopold Toetsch wrote: > > Not quite. It gives one value if one is true or 0 (false). This is more > > information then the perl5 implementation returns. The returned value (if > > any) is still true but usable, if

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Patrick R. Michaud
On Fri, Dec 10, 2004 at 08:50:46PM +0100, Leopold Toetsch wrote: > >> We need language lawyers ;) > > > IANAL, but I am a mathematician.Because C necessarily always > > depends on *both* its arguments, analogies with C and C are > > inappropriate.C cannot short-circuit, and it is not sensi

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Leopold Toetsch
Mike Guy <[EMAIL PROTECTED]> wrote: > Leopold Toetsch <[EMAIL PROTECTED]> wrote >> dropping bitwise xor, and including "undef xor undef" reveals that Perl5 > has a different opinion then Parrot (or Perl6?). > inline op xor(out INT, in INT, in INT) :base_core { > $1 = ($2 && ! $3) ? $2 : ($3 && !

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Sam Ruby
Mike Guy wrote: Perl5 C always returns a "standard" boolean value, i.e. dualvar(0, '') or dualvar(1, '1').Perl6/Parrot should do the same thing. Try: perl -le "print 'day' xor 'night'" On the version of Perl I have installed, I get "day" as the result. - Sam Ruby

RE: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Gordon Henriksen
Precedence. print("day\n" xor "night\n"); -- Gordon Henriksen IT Manager ICLUBcentral Inc. [EMAIL PROTECTED] -Original Message- From: Sam Ruby [mailto:[EMAIL PROTECTED] Sent: Friday December 10, 2004 13:28 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Mike Guy
Leopold Toetsch <[EMAIL PROTECTED]> wrote > dropping bitwise xor, and including "undef xor undef" reveals that Perl5 has a different opinion then Parrot (or Perl6?). inline op xor(out INT, in INT, in INT) :base_core { $1 = ($2 && ! $3) ? $2 : ($3 && ! $2) ? $3 : 0; goto NEXT(); } > We need la

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Leopold Toetsch
Eirik Berg Hanssen <[EMAIL PROTECTED]> wrote: > Which Perl5 (xor, undef) would this be? It does not look like the > result is undef around here: > [EMAIL PROTECTED]:~$ perl -le 'print defined($_)?"defined":"undef", ": «$_»" > for map {(undef xor $_), ($_ xor undef), (undef ^ $_), ($_ ^ undef)}

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Eirik Berg Hanssen
Leopold Toetsch <[EMAIL PROTECTED]> writes: > Sam Ruby <[EMAIL PROTECTED]> wrote: > >> I took a look into this. Apparently, in Perl5, the result of xor'ing >> undef with anything is undef. I'm not suggesting that this is either >> right or wrong (it actually was surprising to me), > > Yep. It do

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Sam Ruby
Eirik Berg Hanssen wrote: Leopold Toetsch <[EMAIL PROTECTED]> writes: Sam Ruby <[EMAIL PROTECTED]> wrote: I took a look into this. Apparently, in Perl5, the result of xor'ing undef with anything is undef. I'm not suggesting that this is either right or wrong (it actually was surprising to me),

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Sam Ruby
Leopold Toetsch wrote: Sam Ruby <[EMAIL PROTECTED]> wrote: I took a look into this. Apparently, in Perl5, the result of xor'ing undef with anything is undef. I'm not suggesting that this is either right or wrong (it actually was surprising to me), Yep. It doesn't really follow the definition of x

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Leopold Toetsch
Sam Ruby <[EMAIL PROTECTED]> wrote: > I took a look into this. Apparently, in Perl5, the result of xor'ing > undef with anything is undef. I'm not suggesting that this is either > right or wrong (it actually was surprising to me), Yep. It doesn't really follow the definition of xor, nor does it

Re: [CVS ci] class refactoring 1 - Integer

2004-12-10 Thread Sam Ruby
Leopold Toetsch wrote: Leopold Toetsch wrote: Currently one test (t/pmc/pmc_43.pasm) is failing due to wrong inheritance. Actually not because of inheritance. The implementation of PerlUndef.logical_xor was bogus. I've fixed this and the test. I took a look into this. Apparently, in Perl5, the r

Re: [CVS ci] class refactoring 1 - Integer

2004-12-09 Thread Leopold Toetsch
Leopold Toetsch wrote: Currently one test (t/pmc/pmc_43.pasm) is failing due to wrong inheritance. Actually not because of inheritance. The implementation of PerlUndef.logical_xor was bogus. I've fixed this and the test. leo