Fix map>assoc where the input is a specialized array
parent
7cbf7ba719
commit
3c95a5a3ea
|
@ -87,3 +87,9 @@ unit-test
|
||||||
[ H{ { 1 2 } { 3 4 } } ]
|
[ H{ { 1 2 } { 3 4 } } ]
|
||||||
[ "hi" 5 H{ { 1 2 } { 3 4 } } clone [ rename-at ] keep ]
|
[ "hi" 5 H{ { 1 2 } { 3 4 } } clone [ rename-at ] keep ]
|
||||||
unit-test
|
unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
H{ { 1.0 1.0 } { 2.0 2.0 } }
|
||||||
|
] [
|
||||||
|
F{ 1.0 2.0 } [ dup ] H{ } map>assoc
|
||||||
|
] unit-test
|
||||||
|
|
|
@ -135,7 +135,7 @@ M: assoc assoc-clone-like ( assoc exemplar -- newassoc )
|
||||||
[ 0 or + ] change-at ;
|
[ 0 or + ] change-at ;
|
||||||
|
|
||||||
: map>assoc ( seq quot exemplar -- assoc )
|
: map>assoc ( seq quot exemplar -- assoc )
|
||||||
>r [ 2array ] compose map r> assoc-like ; inline
|
>r [ 2array ] compose { } map-as r> assoc-like ; inline
|
||||||
|
|
||||||
M: assoc >alist [ 2array ] { } assoc>map ;
|
M: assoc >alist [ 2array ] { } assoc>map ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue