3 ms·
I assume a struct is a Hash/Dict type. Since you have no type checking all fields can be considered dynamic.
by rowanG077 3y ago
I assume a struct is a Hash/Dict type. Since you have no type checking all fields can be considered dynamic.
- JonasWanke 3y agoExactly, structs are also used as maps/dictionaries, and the current implementation of them in our VM is as hash maps. (We have optimizations planned for this.) You'd create a struct with tags (symbols) as keys to create a typical struct/class, and can use arbitrary keys if you want to use it as a more general map: # A struct with two tags as keys mapping to functions httpServerStruct = [GetNextRequest: { … }, Close: { … }] # A map with text keys capitalCitiesMap = ["Germany": "Berlin", "France": "Paris"]