Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'so' doesn't work like prefix:<?> in Rakudo #2128

Closed
p6rt opened this issue Sep 1, 2010 · 6 comments
Closed

'so' doesn't work like prefix:<?> in Rakudo #2128

p6rt opened this issue Sep 1, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 1, 2010

Migrated from rt.perl.org#77604 (status was 'resolved')

Searchable as RT77604$

@p6rt
Copy link
Author

p6rt commented Sep 1, 2010

From @masak

<masak> rakudo​: say ?( any(Bool​::True, Bool​::False) )
<p6eval> rakudo 2ac5fe​: OUTPUT«1␤»
<masak> rakudo​: say so any(Bool​::True, Bool​::False)
<p6eval> rakudo 2ac5fe​: OUTPUT«any(Bool​::True, Bool​::False)␤»
* masak submits rakudobug

One would think that 'so' is implemented as an identity operation.

our multi prefix​:<so>($x) { ?$x }

Hm, guess not. Well, that only makes the bug even stranger.

@p6rt
Copy link
Author

p6rt commented Sep 1, 2010

From @moritz

On Tue Aug 31 20​:51​:37 2010, masak wrote​:

One would think that 'so' is implemented as an identity operation.

our multi prefix​:<so>($x) { ?$x }

Which is exactly the problem​: since $x is typed to Any, autothreading
happens.

Fixed in 606c5fb615b2986a068c769ef72d7a8448154a84 (and also for prefix
not), taking for tests.

@p6rt
Copy link
Author

p6rt commented Sep 1, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Sep 1, 2010

From @moritz

Now tested in t/spec/S03-junctions/boolean-context.t.

@p6rt
Copy link
Author

p6rt commented Sep 1, 2010

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 1, 2010
@p6rt
Copy link
Author

p6rt commented Sep 1, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S03-junctions/boolean-context.t

commit 47cf1b0a7a3249aa2c8c703f699e90df63a9eef6
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Wed Sep 1 19​:13​:44 2010 +0000

  [t/spec] unfudge tests for RT #​77604
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;32124 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S03-junctions/boolean-context.t b/t/spec/S03-junctions/boolean-context.t
index 93886a5..4368119 100644
--- a/t/spec/S03-junctions/boolean-context.t
+++ b/t/spec/S03-junctions/boolean-context.t
@@ -57,23 +57,18 @@ ok !($undef ^ 0), 'undef^0 in boolean context';
 #?rakudo skip 'Mu and =='
 ok ?(0|$undef == 0), '0|undef == 0 in boolean context';
 
-my $message1 = 'boolean context collapses junctions';
-my $message2 = '...so that they\'re not junctions anymore';
+my $message1 = 'boolean context collapses Junctions';
+my $message2 = '...so that they\'re not Junctions anymore';
 ok ?(Bool::True & Bool::False)    ==  Bool::False, $message1;
 #?DOES 1
-#?rakudo skip 'junction type (lower case)'
-ok ?(Bool::True & Bool::False)    !~~ junction,    $message2;
+ok ?(Bool::True & Bool::False)    !~~ Junction,    $message2;
 ok !(Bool::True & Bool::False)    ==  Bool::True,  $message1;
 #?DOES 1
-#?rakudo skip 'junction type (lower case)'
-ok !(Bool::True & Bool::False)    !~~ junction,    $message2;
+ok !(Bool::True & Bool::False)    !~~ Junction,    $message2;
 #?rakudo todo 'named unary as function call'
 ok so(Bool::True & Bool::False) ==  Bool::False, $message1;
-#?rakudo skip 'junction type (lower case)'
-ok so(Bool::True & Bool::False) !~~ junction,    $message2;
-#?rakudo todo 'not does not enforce boolean context?'
-ok not(Bool::True & Bool::False)  ==  Bool::True,  $message1;
-#?rakudo skip 'junction type (lower case)'
-ok not(Bool::True & Bool::False)  !~~ junction,    $message2;
+ok (so Bool::True & Bool::False) !~~ Junction,    $message2;
+ok ( not Bool::True & Bool::False)  ==  Bool::True,  $message1;
+ok not(Bool::True & Bool::False)  !~~ Junction,    $message2;
 
 # vim: ft=perl6

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant