I miss a function to create a Map dynamically from a key type and value type.
brianTue 25 Oct 2011
Promoted to ticket #1679 and assigned to brian
brianMon 14 Nov 2011
Ticket cancelled
This functionality actually already exists - I should have checked first. You just need to create a parameterized type:
type := Map#.parameterize(["K":Str#, "V":Slot#])
map := Map(type)
jessevdamWed 16 Nov 2011
That is true, problem is that the parameterize is not implemented in JS
DanielFathSat 26 Nov 2011
To chime in I think Map(Type K, Type V) would also serve as a nice shortcut for people who find Key:Val[:] hard and Map(Map#.parameterize(["K":Str#, "V":Slot#])) too verbose. I kinda expected it to already exist based on List[Type of, int capacity].
brianSun 27 Nov 2011
To chime in I think Map(Type K, Type V) would also serve as a nice shortcut for people who find Key:Val[:] hard
Note they are two very different things: K:V is parameterization at compile time, what we are discussing here is parameterization at runtime.
jessevdam Tue 25 Oct 2011
I miss a function to create a Map dynamically from a key type and value type.
brian Tue 25 Oct 2011
Promoted to ticket #1679 and assigned to brian
brian Mon 14 Nov 2011
Ticket cancelled
This functionality actually already exists - I should have checked first. You just need to create a parameterized type:
jessevdam Wed 16 Nov 2011
That is true, problem is that the parameterize is not implemented in JS
DanielFath Sat 26 Nov 2011
To chime in I think Map(Type K, Type V) would also serve as a nice shortcut for people who find
Key:Val[:]
hard andMap(Map#.parameterize(["K":Str#, "V":Slot#]))
too verbose. I kinda expected it to already exist based onList[Type of, int capacity]
.brian Sun 27 Nov 2011
Note they are two very different things:
K:V
is parameterization at compile time, what we are discussing here is parameterization at runtime.DanielFath Sun 27 Nov 2011
I know the difference, however to a novice
is harder to understand than
.