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

Seq:D ~~ Seq:D uses Any.ACCEPTS #6242

Open
p6rt opened this issue May 13, 2017 · 1 comment
Open

Seq:D ~~ Seq:D uses Any.ACCEPTS #6242

p6rt opened this issue May 13, 2017 · 1 comment
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented May 13, 2017

Migrated from rt.perl.org#131302 (status was 'new')

Searchable as RT131302$

@p6rt
Copy link
Author

p6rt commented May 13, 2017

From @zoffixznet

Lists have their own .ACCEPTS that does the check based on elements.
You can smartmatch a Seq against a List or Array and get that behaviour, but if you smartmatch
it against another Seq, you get the default Any.ACCEPTS behaviour.

  <Zoffix_> m​: say (1,).Seq ~~ (1,)
  <camelia> rakudo-moar ba0581​: OUTPUT​: «True␤»
  <Zoffix_> m​: say (1,).Seq ~~ [1,]
  <camelia> rakudo-moar ba0581​: OUTPUT​: «True␤»
  <Zoffix_> m​: say (1,).Seq ~~ (1,).Seq
  <camelia> rakudo-moar ba0581​: OUTPUT​: «False␤»

IMO it should do the same thing as List.ACCEPTS while, perhaps, .cache'ing the Seq in the process

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant