# New Ticket Created by  "Stephen Simmons" 
# Please include the string:  [perl #58302]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58302 >


I've attached a file, junctions.p6, which illustrates that binary junctions
treat "undef" as true, and not as false.  My interpretation is that if you
have:
if JUNCTION { THEN }

the JUNCTION simplifies down to a simple logical operation, as in Perl 5
(Though ^ doesn't mean quite the same thing with more than two operands).
 Test cases 34-37 were an attempt to use them in other contexts, and it
seems that in an equality context, they work fine (or at least better).

Thus 1|undef is evaluated as true, as is 1&undef; but 0|undef is also
evaluated as true.  On the other hand, 1^undef is true which contradicts the
theory, but 0^undef is true as well.

The output of the attached perl script is shown below.

ok 1
not ok 2
not ok 3
ok 4
not ok 5
not ok 6
not ok 7
ok 8
ok 9
not ok 10
ok 11
not ok 12
ok 13
ok 14
not ok 15
not ok 16
ok 17
ok 18
ok 19
ok 20
not ok 21
not ok 22
ok 23
ok 24
ok 25
not ok 26
ok 27
not ok 28
not ok 29
not ok 30
not ok 31
not ok 32
not ok 33
not ok 34
not ok 35
not ok 36
ok 37

System info:
sully:parrot stephensimmons$ perl6 -v
This is Rakudo Perl 6, revision 30440 built on parrot 0.7.0-devel
for darwin-thread-multi-2level.

Copyright 2006-2008, The Perl Foundation.

sully:parrot stephensimmons$ uname -a
Darwin sully.local 9.4.0 Darwin Kernel Version 9.4.0: Mon Jun  9 19:30:53
PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386 i386

Stephen Simmons

Attachment: junctions.p6
Description: Binary data

Reply via email to