From: Shawn P. <sha...@gm...> - 2011-08-31 13:43:22
|
On 31/08/2011 4:37 AM, Jeremy Cowgar wrote: > Just to kick around a few other ideas... these are only ideas, not sure any > of them are even good or mediocre ideas but with such an important language > design, we should have a few. Best way to have a good idea is to have many, > right? > How about this: value = map:get( this_map, mykey ) set( this_map, mykey, new_value ) You could have two implementations of maps in the same program. Whereas one might be faster for some kind of data the other might be better for the other. This is a fundamental reason to reuse function names. Imagine it might be used like this: include std/map.e as country_names -- map of country_names (using the 4.0 front end version) include std/bemap.e as stmap -- map for students (using the backend) include std/bemap.e as pmap -- map of parents In this example, the maps involving students use stmap namespace for all of its operations and those using country_names use the country_names namespace. What might be faster in some situations can be and often is slower in others. The user (programmer) can choose which implementation before, during and after writing his code using the maps when the interface is reused over. You can use the so called "machine" interface as with regex.e rather than builtins. I don't think we should add this to the default namespace. It is better to allow a user to include it or not include it. Shawn |