Re: Eu improvements (Part 1)

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

c.k.lester wrote:
> 
> Karl Bochert wrote:
> > 
> > The 'fixed sequence':
> > 1) has named elements
> > 2) cannot have its structure modified
> > 3) contains only data (like any other sequence)
> > 4) may be put in another sequence without losing its
> >    identity (like any other data)
> 
> That's a cool idea, Karl. It seems to take sequences to the next level.
> 
> I guess you could then do
> 
> sequence line is
>    point x
>    point y
> end sequence
> 
> sequence shape is
>    line a
>    line b
>    line c
> end sequence
> 
> I suspect it won't be easy to implement, eh?

Well, the ooeu equivalent is:
euclass point( sequence p )
    atom x, y
end euclass

euclass line( sequence l ) point p1, p2 end euclass

euclass shape( sequence s ) line a, b, c end euclass </euclass>

One of the demos that comes with ooeu is shape.ex, and shows some simple ways that you can build up objects from other objects. There is no enforcement of changing the structure in ooeu, however.

Matt }}}

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

Search



Quick Links

User menu

Not signed in.

Misc Menu