New NG map value types

BlitzMax Forums/BlitzMax NG/New NG map value types

col(Posted 2016) [#1]

Thankyou for the better map key types!

I've personally found the map most useful to use a string for the key and have other basic datatypes for values - ie values of type integer, float etc. For example, to use a string key of "specular" with a value of 0.8.

At the moment you can only have object types for the value or wrap the basic datat type in an object, so I made a couple of versions that have a basic datatype for the value. It works very well except for enumerating through the values themselves ( which requires objects ) and I'd like to offer it for the repo except I don't know what would be best in the case that a key/value pair don't exist? return default ( zero ) values? Throw an exception maybe? Also, what other edge cases may crop up and cause possible problems?

Hmm Thinking about, maybe its no good for public release because of not being able to enumerate through the values. What I have works very well for my personal use but I guess it isn't really complete without the value enumeration available.