EU improvements (Part 2)
- Posted by Karl Bochert <kbochert at copper.net> Jan 03, 2007
- 507 views
sequence point is atom x, y end sequence
The fixed sequence declaration creates a real sequence in memory, but it also describes a datatype. Therefore it should be able to be used to define data just like any other datatype. Also like any other datatype, it should be usable as a function.
point x, y -- create 2 points point(foo) -- is foo a point?
This creates a user defined type by restricting the types in a sequence, much as Eu's 'type' creates a user defined type by restricting the values of an existing type. The sequences 'x' and 'y' are simply created as exact duplicates of the sequence 'point', values and all. We can now create complex sequences whose elements are named(documented) and enforced(fewer bugs). KtB