Re: Object Oriented Euphoria
Tone Škoda wrote:
>
> Matt, this looks very good. I would use it, especially if preprocessor will be
> available
> so that there is no speed loss. If only it would work more "intuitive", like
> example
> I gave below.
It turns out the preprocessor is fairly trivial, now that it correctly
parses. I'm basically adding a '-p' command line option. It will then
parse the program, and any files that needed to be modified are rewritten
into a 'preprocess' subdirectory (from the directory where the main
file was).
> I would also like to use classes as structures, ie only data no routines.
> Because the
> meaning of OO or classes for me is in that it helps me organize my code more
> clear.
I'll have to think about how to manage this. Or maybe you can. :)
> I like name class more than euclass.
Me, too, but I've got several projects where class already exists, and I
think euclass isn't too bad. We'll see. You can always change it in
your copy, and use that in your code (keylist.e).
> About trace or debugger: in my opinion it should be part of editor, so that
> you have
> all at one place. Debugger will have to display lines of code anyway, why not
> use an
> existing editor to do it?
I'd like to have a nicer, GUI based editor, and I don't want to bloat the
code to include all that. I *do* plan to give an API that others can
use to build whatever sort of debugger they'd like.
> }}}
<eucode>
>
> include get.e
>
> euclass PERSON
> integer age
> sequence name
> procedure show_stats ()
> printf (1, "Persons name is %s and is %d years old.\n",
> {name, age})
> end procedure
> end euclass
>
> PERSON tone
> tone.age = 23
> tone.name = "Tone Škoda"
> tone.show_stats ()
>
> if wait_key () then end if
>
> </eucode>
{{{
Hmmm...I've thought about making separate data, but I decided against it,
because there would be other issues, like when and how to copy things.
All data would be held in the class object itself (so maybe it's a
sequence). It would probably be possible to turn something like the
above into:
me.name ==> me[1]
Matt Lewis
|
Not Categorized, Please Help
|
|