Open fergusq opened 9 years ago
What kind of syntax should they use? Probably for accessing data []-syyntax would be appropriate. But how about for the type? What hash function to use? A perfect hash based on trie or some other hash?
Maybe
Dim map as Integer[String]
is a hashmap
vs.
Dim array as Integer[Integer] = x
which would be a variable length array (cannot be initiated, but assigned)
Integer[]
would be an alias to Integer[Integer]
I think Dim map As Integer[String]
should be just intepreted as an Integer array with the size of the value referenced by String
. How about using {}
for hash maps?
Do you mean Dim map as Integer{}
? That is not logical, as then we should use map{key}
as the accessing syntax.
I can't figure out a situation where I needed to create an array which has the size of the string type.
What about syntaxes {String=>Integer}
, array [Integer]
.
Pascal-like syntaxes Dim map as Map[] of Integer
and Dim array as Array[] of Integer
could work
They could also support multiple keys, like Dim map as Map[,,] of Integer
and Dim array as Array[12, 10] of Integer
.
I would prefer the Integer[String] syntax. Note that user should be able to mix hashmaps and regular arrays. Eg. Dim foo As Integer[String][10][10]
Tables with string keys