Re: Eu improvements (part 4)

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

Matt Lewis wrote:
> 
> Karl Bochert wrote:
> > 
> > Do you object to others using SS? Why?
> > Perhaps what you want is not to avoid SS, but to extend it??
> }}}
<eucode>
> >   sequence colors is
> >     constant
> >         blue = 3, red = 1
> >   end sequence
> >   ?length(colors)  --> 0 
> >   ?colors.blue     --> 3
> </eucode>
{{{

> This is basically what ooeu does (although you don't have to declare what
> the constants will be).  They're defined similar to an enum:
> }}}
<eucode>
> euclass foo( sequence f )
>     integer bar, baz
> end euclass
> 
> ? foo.bar   -- output 1
> ? foo.baz   -- output 2
> </eucode>
{{{

> 
> Matt

Sorry for the double post--

Do bar and baz have any meaning outside of the context of foo? Do they have any
value that you can check?

If you have another object, moo, that doesn't have bar or baz in it's definition
(but does have something in that placeholder) does moo.bar or moo.baz have any
meaning?

Last question--are foo.bar and foo[bar] interchangeable?
--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare
j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu