AW: [Oberon] Renaming imported procs (was: concrete use of open array)
Jörg Straube
joerg.straube at iaeth.ch
Fri Jul 2 04:00:32 MEST 2010
--- spir.wikidot.com wrote
> Right, I will need such a pattern for higher-order funcs. Not that
> appreciate the functional paradigm, but some match typical patterns,
> eg for collections (find --> element; filter, map --> collection;
> any, every --> boolean). I particuliarly like the clarity of code
> 'every' enables:
> IF numbers.every(isNaturalNumber) THEN ...
> IF objects.every(isNotNil) THEN ...
> IF inputData.every(isValid) THEN ...
You're right, Oberon does offer e.g. ARRAY OF REAL but
no higher functions like "filter" or "every" that work on it
natively.
The good news however: these functions can be added if needed.
The higher data type (Element, Collection..) and their
corresponding functions (find, filter, every..) are encapsulated
in a MODULE. Instantiation, input and output of those
higher data structures should be handled in this MODULE as
well.
br
Joerg
More information about the Oberon
mailing list