EU improvements (Part 2)

new topic     » topic index » view thread      » older message » newer message



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

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu