Skip to content
Permalink
Browse files

[CaR Grant] Make Map.list return a List instead of Seq

Partially fixes R#1344 #1344

Since (per discussion on the Issue) a Seq is not a "list", the
.list/.cache methods need to return a Positional. This commit is
required for the grant to have proper coersion+typecheck
on `@`-sigilled constants. The rest of the Issue still requires
filling in the gaps in positional slurpy semantics
( R#1355 #1355 )
  • Loading branch information...
zoffixznet committed Jun 17, 2018
1 parent c49a6ed commit 60447c6267b5ba9a1557befdacecf0e1d4a12358
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/core/Map.pm6
@@ -171,7 +171,10 @@ my class Map does Iterable does Associative { # declared in BOOTSTRAP
}
}.new(self)
}
method list(Map:D:) { Seq.new(self.iterator) }
method list(Map:D:) {
nqp::p6bindattrinvres(
nqp::create(List),List,'$!reified',self.IterationBuffer)
}
multi method pairs(Map:D:) { Seq.new(self.iterator) }
multi method keys(Map:D:) { Seq.new(Rakudo::Iterator.Mappy-keys(self)) }
multi method values(Map:D:) { Seq.new(Rakudo::Iterator.Mappy-values(self)) }

0 comments on commit 60447c6

Please sign in to comment.
You can’t perform that action at this time.