NamedMap to accept/convert integers?
Issue #20
closed
With Record, it was convenient to
for ( i <- 1 to 3) {
segment(i)=SegmentSeeded(in= ... )
}
do we have to use i.toString or could NamedMap auto-convert that itself?
Comments (5)
-
reporter -
I can implement these as a convenience function for NamedMap.
Previously, org.anduril.runtime implicitly converted all integers to strings (not only for Record), which is a bad idea in general for statically typed languages.
-
reporter yeah, now parameters have to be converted. not a biggie.
-
Integer functions are now there.
But I was wondering if NamedMap is the correct data structure for your case. A map having integer keys 0, 1, ..., N-1 is called a sequence, and NamedSeq can be used. Map is needed if the keys are sparse and non-contiguous, like if you have keys 5, 620 and 7840 only.
-
- changed status to closed
- Log in to comment
same goes for accessing NamedMaps