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

duckmap doesn't retain structure types #5696

Closed
p6rt opened this issue Sep 26, 2016 · 5 comments
Closed

duckmap doesn't retain structure types #5696

p6rt opened this issue Sep 26, 2016 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Sep 26, 2016

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

Searchable as RT129363$

@p6rt
Copy link
Author

p6rt commented Sep 26, 2016

From @dogbert17

While discussing RT #​129321 TimToady found another problem with duckmap, see

http://irclog.perlgeek.de/perl6/2016-09-26#i_13285724

The problem can be shown with a couple of examples, one with duckmap where
structure is lost

dogbert@​dogbert-VirtualBox ~/repos/rakudo $ ./perl6 -e 'my @​a = [1,
[2,3],4]; dd duckmap(-> Int $x { $x ~~ Int ?? $x !! Any }, @​a)'
(1, (2, 3), 4)

According to TimToady the result should have been

[1, [2, 3], 4]

deepmap, on other hand, does retain structure as can be shown with

dogbert@​dogbert-VirtualBox ~/repos/rakudo $ ./perl6 -e 'my @​a = [1,[2,3],4];
say @​a.deepmap({ $_ + 1 })'
[2 [3 4] 5]

/dogbert17

@p6rt
Copy link
Author

p6rt commented Nov 8, 2016

From ctp@fastmail.co.uk

Pull requests raised for discussion​:

rakudo/rakudo#915
Raku/roast#180

@p6rt
Copy link
Author

p6rt commented Nov 8, 2016

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

@p6rt
Copy link
Author

p6rt commented Nov 9, 2016

From @zoffixznet

On Tue, 08 Nov 2016 06​:31​:15 -0800, ctp@​fastmail.co.uk wrote​:

Pull requests raised for discussion​:

rakudo/rakudo#915
Raku/roast#180

Merged. Thanks.

@p6rt
Copy link
Author

p6rt commented Nov 9, 2016

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

@p6rt p6rt closed this as completed Nov 9, 2016
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