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

Can't put a Set in a %var #2152

Closed
p6rt opened this issue Sep 9, 2010 · 4 comments
Closed

Can't put a Set in a %var #2152

p6rt opened this issue Sep 9, 2010 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Sep 9, 2010

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

Searchable as RT77760$

@p6rt
Copy link
Author

p6rt commented Sep 9, 2010

From philip.g.potter@gmail.com

[17​:56​:50] <rhebus> rakudo​: my %v = Set.new(<a b c>)
[17​:56​:54] <p6eval> rakudo 859f2d​: OUTPUT«Odd number of elements found
where hash expected␤ in '!STORE' at line 5004​:CORE.setting␤ in main
program body at line 22​:/tmp/j0wKjmZefu␤»
[17​:57​:11] <rhebus> shouldn't I be able to put a Set in a %var?
[17​:57​:20] <rhebus> since Set does Associative?

@p6rt
Copy link
Author

p6rt commented Sep 17, 2010

From @Kodiologist

Actually, in 'my %v = Set.new(<a b c>)', %v is a Hash, and remains so
regardless of what you assign to it. I don't think the Synopses
explicitly specify what should be the result of assigning a Set to a
Hash, but I would expect to get '{a => True, b => True, c => True}', so
as to be consistent to KeyHashes. There is a test for this behavior in
S02-builtin_data_types/set.t, and as of Rakudo da7c7f9b3041, it passes.

If you want a %var to actually be a Set, say '%var := set <a b c>' or
'%var is Set' (although only the former works at the moment).

@p6rt
Copy link
Author

p6rt commented Sep 17, 2010

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

@p6rt
Copy link
Author

p6rt commented Sep 17, 2010

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

@p6rt p6rt closed this as completed Sep 17, 2010
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