Re: named array
- Posted by jimcbrown (admin) Sep 05, 2013
- 1872 views
My approach - always make clones, even if they are not needed.
Which works fine with Euphoria maps as well.
Agreed - a mutable map type (like the one in Euphoria) has a lot more functionality.
In my particular case, this functionality is not only superfluous but also harmful.
Based on the needs that you have described so far, I disagree. It appears to be harmless. In fact, you contradict yourself on this point - Python's Dict type is also mutable (and should therefore suffer from the same disadvantages), yet you do not treat this as harmful.
If I understand correctly, your preprocessor example would be, though. I agree that, for stylistic reasons, that would be the better approach. Adding a new literal symbol type should be done by adding a new literal symbol type, with syntax sugar and all, not by faking it with arrays and strings or maps.
This is my dream.
Actually, I believe something like this has already been implemented in the alternative_literals branch: http://openeuphoria.org/ticket/657.wc