From: Jeremy C. <je...@co...> - 2011-08-31 13:55:50
|
Maps are as essential to a programming language as the the array. Would you want to program like: array:set_element(my_array, 1, "John") value = array:get_element(my_array, 1) instead of my_array[1] = "John" value = my_array[1] Why are you so against enhancing the language for common use patterns? Enhancing the language for situations that never occur should be avoided like the plague. Jeremy -----Original Message----- From: Shawn Pringle Sent: Wednesday, August 31, 2011 9:43 AM To: rap...@li... Subject: [Rapideuphoria-develop] Map Interfface Ideas: Maps in 4.1? 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 ------------------------------------------------------------------------------ Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev _______________________________________________ Rapideuphoria-develop mailing list Rap...@li... https://lists.sourceforge.net/lists/listinfo/rapideuphoria-develop |