Re: OO Eu - Where are Member Variables

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

Dave Probert wrote:
> 
> Ok, now I'm confused.
> 
> I've got the 2.5 installation working fine, and the OO version seems to work
> with the
> class.ex axample, but I'm kinda lost on the documentation!
> 
> There seems to be no ability to add Member variables to the euclass - only
> Methods.
>  This is not very useful as a class needs to have both - encapsulated data and
>  the
> functions that work with said data.  All the examples I've seen just have a
> few methods
> which are called, but no examples of using an internal member variable.
> 

<snip>

> 
> After even more attempts I got to the point where I had no member variables
> and needed
> to assign a value to the instance of the class (jim = 6)  What is the purpose
> of giving
> a class (which is a structure of information) a single value??  Or am I
> missing something
> completely?  
> There really needs to be a lot of small examples available of how all this is
> supposed
> to work - 'Cos it ain't obvious even to a seasoned programmer like me.
> 
> I really want to see this become a de-facto standard for OO, so it's gonna
> need more
> support.

Correct, there is no such thing as member variables.  My examples are 
pretty simple.  If you want to have lots of member data, then you should
write the class as a sequence, and store the members there.  In the future,
I may add an ability to use dot notation to refer to members of the 
sequence.

All the data has to be in that variable, because all methods need to 
have access to it.  If I don't put everything together, then I'm going
to need to add not just the 'this' param, but all of the member info,
as well.

I have a specific use where a class would be an atom:  when using things
like COM or wxEuphoria.  The objects are really managed elsewhere, and
I just have a pointer to them.

Matt Lewis

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

Search



Quick Links

User menu

Not signed in.

Misc Menu