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

Nil disappears in junction lists #3313

Closed
p6rt opened this issue Jan 14, 2014 · 6 comments
Closed

Nil disappears in junction lists #3313

p6rt opened this issue Jan 14, 2014 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jan 14, 2014

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

Searchable as RT120992$

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

From mark@kli.org

 

 
 
 
 
  > (all("a", "b") ~~ /a/).Bool

  True

  > all("a", "b") ~~ /a/

  「all("a", "b")」

 

  > (all("a", "b") ~~ /a/).perl

  Match.new(orig => all("a", "b"), from => 0, to => 1, ast
  => Any, list => ().list, hash => EnumMap.new())

  >

 

  What's going on is that the failed match returns a Nil, which
  disappears when it is added to the elements of the junction, so we
  get a junction of one element, which is True.

 

 

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

From @timo

What's going on is that the failed match returns a Nil, which
disappears when
it is added to the elements of the junction, so we get a junction of
one
element, which is True.

That's not quite right; the problem stems from the list iteration that happens to extract the slurpy arguments to the constructor of the junction; If we build a second constructor for junctions that takes a full array rather than slurpies, we can get around this problem even before the full list re-work is done.

@p6rt
Copy link
Author

p6rt commented Jan 14, 2014

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

@p6rt
Copy link
Author

p6rt commented Oct 21, 2015

From @usev6

This works now​:

< bartolin> r​: say all("a", "b") ~~ /a/ # RT #​120992
<+camelia> rakudo-{moar,jvm} 5d83db​: OUTPUT«all(「a」, Nil)␤»

I added a test to S03-junctions/misc.t with commit Raku/roast@50c2c6c8d9

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 21, 2015

From @usev6

This works now​:

< bartolin> r​: say all("a", "b") ~~ /a/ # RT #​120992
<+camelia> rakudo-{moar,jvm} 5d83db​: OUTPUT«all(「a」, Nil)␤»

I added a test to S03-junctions/misc.t with commit Raku/roast@50c2c6c8d9

I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Oct 21, 2015
@p6rt
Copy link
Author

p6rt commented Oct 21, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant