Re: Euphoria pre-processor
- Posted by Jeffrey Fielding <JJProg at CYBERBURY.NET> Sep 02, 1998
- 581 views
>I like some features of OOP too, but Euphoria is *not* OOP, and to make >it object-oriented would bloat it IMO; look at what happened to C++: >procedural + OO functionality made for quite a large compiler. >And if even a subset of OO was added to the interpreter, then it would >create larger bound programs... I agree that adding OO to the interperter would make it much larger. What I ment was to convert an object-oriented version of Euphoria to the standard version. The existing interperter works fine, but it is difucult to write programs that use an object-oriented design in standard Euphoria because you have to set up things like: constant FIRST_NAME =3D 1, LAST_NAME =3D 2, E_MAIL =3D 3 type entry(sequence s) if length(s) =3D 3 then return sequence(s[FIRST_NAME]) and sequence(s[LAST_NAME]) and sequence(s[E_MAIL]) end if return 0 end type entry me me[FIRST_NAME] =3D "Jeffrey" me[LAST_NAME] =3D "Fielding" me[E_MAIL] =3D "JJProg at cyberbury.net" -- etc... However, using a pre-processor, you could write: struct entry sequence first_name sequence last_name sequence e_mail end struct entry me me.first_name =3D "Jeffrey" me.last_name =3D "Fielding" me.e_mail =3D "JJProg at cyberbury.net" -- etc... and the pre-processor would write the standard Euphoria code for you (and possibly even optomize it). Jeffrey Fielding JJProg at cyberbury.net