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

Baggy/Setty .Str/.gist/.perl needs to guarantee order, like Map/Hash do #6218

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

Comments

@p6rt
Copy link

p6rt commented May 2, 2017

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

Searchable as RT131244$

@p6rt
Copy link
Author

p6rt commented May 2, 2017

From @zoffixznet

https://irclog.perlgeek.de/perl6-dev/2017-05-02#i_14519628

* TimToady notes that .perl and .gist do guarantee sorted order
16​:02 Zoffix s​: bag(), 'perl', \()
16​:02 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/08a8075/src/core/Baggy.pm#L375
16​:03 Zoffix Don't look like it
16​:03 TimToady they're supposed to
16​:03 Zoffix And if it does, then .Stringy also does, 'cause they're using the same Baggy!LISTIFY method
16​:04 TimToady you can always iterate a hash yourself if you really want unordered
16​:04 sets and bags should follow the same policy
16​:05 Zoffix So Hash.Str is guaranteed to be ordered?
16​:05 Oh yeah​: multi method Str(Map​:D​:) { self.sort.join("\n") }
16​:06 m​: use nqp; dd nqp​::getattr(Map.new(<a 42>), Map, '$!storage').^name
16​:06 camelia rakudo-moar 08a807​: OUTPUT​: «"BOOTHash"␤»
16​:07 Zoffix And Baggy takes nqp​::iterator() of BOOTHash and just loops over it... I'm guessing that's unordered
16​:07 timotimo yeah, that's unordered

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