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

gather/take for hashes #2479

Closed
ufobat opened this issue Nov 28, 2018 · 2 comments
Closed

gather/take for hashes #2479

ufobat opened this issue Nov 28, 2018 · 2 comments
Labels
docs Documentation issue (primary issue type)

Comments

@ufobat
Copy link
Contributor

ufobat commented Nov 28, 2018

The Problem

<ufobat> p6: my %h = gather { take "foo" => 1; take "bar" => 2}; say %h
<camelia> rakudo-moar defc2c5a4: OUTPUT: «{bar => 2, foo => 1}␤»
<ufobat> this is intentional, right?
<ufobat> because https://docs.perl6.org/syntax/gather%20take just talked about arrays
<moritz> it's the %h = that turns it into a hash
<moritz> the return value from gather/take is still a Seq
<ufobat> ah okay
<ufobat> i am still unhappy with the documentation because i almost discarded my idea of using gather/take for a hash

Suggestions

I am just posting this as an issue because it might be an good idea to mention that hash example in the documentation as well. It's just an idea.

@JJ
Copy link
Contributor

JJ commented Nov 28, 2018

Thanks. We'll do that.

@JJ JJ added docs Documentation issue (primary issue type) easy to resolve labels Nov 28, 2018
@JJ
Copy link
Contributor

JJ commented Nov 30, 2018

Related; #2388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

2 participants