Navigation Menu

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

Array containing whatever forces numeric context on elements of array matched against it #3576

Closed
p6rt opened this issue Nov 6, 2014 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Nov 6, 2014

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

Searchable as RT123144$

@p6rt
Copy link
Author

p6rt commented Jun 19, 2013

From phiroc@free.fr

In Rakudo 2013.5 on Windows 7,

perl6 -e "if (['a','b'] ~~ (*, 'a', *)) { say 'matches' } else { say 'not' };"

and

perl6 -e "if ['a','b'] ~~ (*, 'a', *) { say 'matches' } else { say 'not' };"

throw a "Cannot convert string to number" error

PS

The following example on http://en.wikibooks.org/wiki/Perl_6_Programming/Control_Structures, is invalid, since ~~ takes precedence on the comma.

["a", "b"] ~~ *, "a", *;

@p6rt
Copy link
Author

p6rt commented Nov 6, 2014

From @bbkr

$ perl6 -e 'say ["a", "b", "c"] ~~ [*, "b", "c" ]�;

Cannot convert string to number​: base-10 number must begin with valid digits or '.' in 'â��a' (indicated by â��)
  in method Numeric at src/gen/m-CORE.setting​:13163
  in sub infix​:<==> at src/gen/m-CORE.setting​:4363
  in sub infix​:<==> at src/gen/m-CORE.setting​:4363
  in block at src/gen/m-CORE.setting​:17668
  in method ACCEPTS at src/gen/m-CORE.setting​:8481
  in block at -e​:1

Rakudo​:
This is perl6 version 2014.08 built on MoarVM version 2014.08
Also on IRC parrot/moar builds at the time of creating this ticket.

@p6rt
Copy link
Author

p6rt commented Sep 22, 2015

From @coke

On Thu Nov 06 15​:11​:04 2014, pawel.pabian@​getresponse.com wrote​:

$ perl6 -e 'say ["a", "b", "c"] ~~ [*, "b", "c" ]�;

Cannot convert string to number​: base-10 number must begin with valid
digits or '.' in '�a' (indicated by �)
in method Numeric at src/gen/m-CORE.setting​:13163
in sub infix​:<==> at src/gen/m-CORE.setting​:4363
in sub infix​:<==> at src/gen/m-CORE.setting​:4363
in block at src/gen/m-CORE.setting​:17668
in method ACCEPTS at src/gen/m-CORE.setting​:8481
in block at -e​:1

Rakudo​:
This is perl6 version 2014.08 built on MoarVM version 2014.08
Also on IRC parrot/moar builds at the time of creating this ticket.

$ ./perl6 -e 'say ["a", "b", "c"] ~~ [*, "b", "c" ]';
True

passing tests in S03-smartmatch/array-array.t

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Sep 22, 2015

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

@p6rt
Copy link
Author

p6rt commented Sep 22, 2015

From @coke

On Thu Nov 06 15​:11​:04 2014, pawel.pabian@​getresponse.com wrote​:

$ perl6 -e 'say ["a", "b", "c"] ~~ [*, "b", "c" ]�;

Cannot convert string to number​: base-10 number must begin with valid
digits or '.' in '�a' (indicated by �)
in method Numeric at src/gen/m-CORE.setting​:13163
in sub infix​:<==> at src/gen/m-CORE.setting​:4363
in sub infix​:<==> at src/gen/m-CORE.setting​:4363
in block at src/gen/m-CORE.setting​:17668
in method ACCEPTS at src/gen/m-CORE.setting​:8481
in block at -e​:1

Rakudo​:
This is perl6 version 2014.08 built on MoarVM version 2014.08
Also on IRC parrot/moar builds at the time of creating this ticket.

$ ./perl6 -e 'say ["a", "b", "c"] ~~ [*, "b", "c" ]';
True

passing tests in S03-smartmatch/array-array.t

--
Will "Coke" Coleda

@p6rt p6rt closed this as completed Sep 22, 2015
@p6rt
Copy link
Author

p6rt commented Sep 22, 2015

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

@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