Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
ELM comes with several functions to make easier the access to files:
These three commands open a file named p and returns an input/output handle ready for reading or writing.
Inputing from a string can be done in the same way:
Outputting to a string requires a StringBuffer:
There is a short cut to this with a special named "_":
To read a file line by line, the function Input::lines() provides an iterator:
ELM comes with several map data structure:
These map implementation shares the same concepts concept::Map and concept::MutableMap. This means they are controlled in the same way.
To add a value to the map, one can type:
To get a value, several alternative exists using default values or options:
In the last form, a KeyException is raised if there is no value for the key.