1. Call for Opinions

Okay, my Euphoria friends and enemies! I'm starting a code survey and need
your participation.

Go to http://www.cklester.com/euphoria/. On the left hand menu you'll see an
item that says "Best of Euphoria." Click it. Now send me your suggestions and
opinions! If you don't, it will only be my opinion and, while that is quite
valid and appropriate, I'd like some community feedback because I don't use
code from every possible category. :)

Thanks!

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » topic index » view message » categorize

2. Re: Call for Opinions

cklester wrote:
> 
> Okay, my Euphoria friends and enemies! I'm starting a code survey and need
> your participation.
> 
> Go to <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>.
> On the left hand menu you'll see an
> item that says "Best of Euphoria." Click it. Now send me your suggestions and
> opinions! ...

CK:

Thanks for mentioning EuGTK, but be aware that it will never be updated. 
Not by me, anyway. If someone else wants to do that, I have no objection.
Mike Sabal has the password for the sourceforge account.

Once I started writing a GTK wrapper for another programming 
language I suddenly realized how NICE it is to have all those features 
which Rob keeps telling us we don't need.

Irv

new topic     » goto parent     » topic index » view message » categorize

3. Re: Call for Opinions

irv mullins wrote:
> cklester wrote:
> > Okay, my Euphoria friends and enemies! I'm starting a code survey and need
> > your participation.
> 
> Thanks for mentioning EuGTK, but be aware that it will never be updated. 

Okay, thanks for the heads-up! I'll have to check out Qu... :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

4. Re: Call for Opinions

cklester wrote:
> 
> Okay, my Euphoria friends and enemies! I'm starting a code survey and need
> your participation.
> 
> Go to <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>.
> On the left hand menu you'll see an
> item that says "Best of Euphoria." Click it. Now send me your suggestions and
> opinions! If you don't, it will only be my opinion and, while that is quite
> valid and appropriate, I'd like some community feedback because I don't use
> code from every possible category. :)
> 

Under DB and DB Interfaces, I think my ODBC library should be included.  
Probably also [wx]EDB.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

5. Re: Call for Opinions

cklester wrote:
> 
> Okay, my Euphoria friends and enemies! I'm starting a code survey and need
> your participation.
> 
> Go to <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>.
> On the left hand menu you'll see an
> item that says "Best of Euphoria." Click it. Now send me your suggestions and
> opinions! If you don't, it will only be my opinion and, while that is quite
> valid and appropriate, I'd like some community feedback because I don't use
> code from every possible category. :)
> 
> Thanks!
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 

Hi CK,

Under "win32lib supplemental libraries", I'd like to nominate EuGrid.

Cheers,

Phil Russell

new topic     » goto parent     » topic index » view message » categorize

6. Re: Call for Opinions

> Okay, my Euphoria friends and enemies! I'm starting a code survey and nee=
d
> your participation.
>
> Go to http://www.cklester.com/euphoria/. On the left hand menu you'll see=
 an
> item that says "Best of Euphoria." Click it. Now send me your suggestions=
 and
> opinions! If you don't, it will only be my opinion and, while that is qui=
te
> valid and appropriate, I'd like some community feedback because I don't u=
se
> code from every possible category. :)

I'd like to see this in the list:

Win32Lib Supplemental Libraries

    xControls - Originally developed by Don Phillips, now under
re-development by Greg Haberek. xControls adds additional controls to
Win32Lib, such as Splitters, Control Position Management (Geometry),
Picture Menus, and a Syntax-highlighting RichEdit control.

Thanks!
~Greg

new topic     » goto parent     » topic index » view message » categorize

7. Re: Call for Opinions

cklester wrote:
> 
> Okay, my Euphoria friends and enemies! I'm starting a code survey and need
> your participation.
> 
> Go to <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>.
> On the left hand menu you'll see an
> item that says "Best of Euphoria." Click it. Now send me your suggestions and
> opinions! If you don't, it will only be my opinion and, while that is quite
> valid and appropriate, I'd like some community feedback because I don't use
> code from every possible category. :)
> 
> Thanks!
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 

What about a section on modified Euphoria interpreters? like
EG, OOEU, etc.


Regards,
Vincent

--
Without walls and fences, there is no need for Windows and Gates.

new topic     » goto parent     » topic index » view message » categorize

8. Re: Call for Opinions

Thank you everybody for your input! The list is getting bigger and better. I'm
going to try and keep the lists restricted to the "Top Ten," so get your vote
in now if you haven't.

Have a look at the revised list (use link below) and if you think any of the
current items are out of order, let me know why you think so! :)

Thanks!!!

-=ck
"Programming in a state of Euphoria."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

9. Re: Call for Opinions

Hey ck,

I'd nominate Jason Mirwald's TCP library for the Networking section, as well
as libCURL by Ray Smith.  Though wxEuphoria covers both of these in
cross-platform capabilities. He he he

Mario Steele
http://enchantedblade.trilake.net
Attaining World Dominiation, one byte at a time...

new topic     » goto parent     » topic index » view message » categorize

10. Re: Call for Opinions

cklester wrote:

> Thank you everybody for your input! The list is getting bigger and better. I'm
> going to try and keep the lists restricted to the "Top Ten," so get your vote
> in now if you haven't.

Thanks for this list, I like it.
I want to nominate
a) the Euphoria assembler
b) Matt's "32bits.zip", an almost indispensable patch for writing DLLs

Is the Crimson Editor written in Euphoria? If not, it IMHO shouldn't be
mentioned on this list.
If you want to make a list of editors that can be used to write Eu
programs, this is a different topic, and such a list probably should
contain 30 editors rather than one. smile

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

11. Re: Call for Opinions

Juergen Luethje wrote:
> 
> cklester wrote:
> 
> > Thank you everybody for your input! The list is getting bigger and better.
> > I'm
> > going to try and keep the lists restricted to the "Top Ten," so get your
> > vote
> > in now if you haven't.
> 
> Thanks for this list, I like it.
> I want to nominate
> a) the Euphoria assembler
> b) Matt's "32bits.zip", an almost indispensable patch for writing DLLs
> 
> Is the Crimson Editor written in Euphoria? If not, it IMHO shouldn't be
> mentioned on this list.
> If you want to make a list of editors that can be used to write Eu
> programs, this is a different topic, and such a list probably should
> contain 30 editors rather than one. smile
> 
> Regards,
>    Juergen
> 
> 

Crimson is not a euphoria program, but if you load 
the proper keywords and syntax files does that make it Euphoric?

Also has anybody really tricked out the user configured tools file?
I just loaded crimson last week, and setup some tools, but it doesn't
seem to use the PATH variable for searching, so I've supplied absolute 
path to commands   

Execute exw <current file>
Run Binder  <current file>
display 2.3 CHM (includes Win32 documentation) 
display 2.4 CHM 
Guru <current word>
search <prompt>
Capture last ex.err (notepad.exe %filedir%) 



--"ask about our layaway plan".
--

new topic     » goto parent     » topic index » view message » categorize

12. Re: Call for Opinions

Juergen Luethje wrote:
> 
> Thanks for this list, I like it.
> I want to nominate
> a) the Euphoria assembler
> b) Matt's "32bits.zip", an almost indispensable patch for writing DLLs

Where should I put those? :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

13. Re: Call for Opinions

Michael Raley wrote:

> Juergen Luethje wrote:

<snip>

>> Is the Crimson Editor written in Euphoria? If not, it IMHO shouldn't be
>> mentioned on this list.
>> If you want to make a list of editors that can be used to write Eu
>> programs, this is a different topic, and such a list probably should
>> contain 30 editors rather than one. smile
>
> Crimson is not a euphoria program, but if you load
> the proper keywords and syntax files does that make it Euphoric?

Maybe. If so, this would also make a bunch of other editors Euphoric.
So why only mention Crimson?
And if they are not written in Euphoria, these programs should not be
mentioned in a list of programs that are written in Euphoria. A proper
category would be e.g. "General tool for writing programs", because
Crimson, ConTEXT, etc.etc. do not provide anything that is *specific*
for Euphoria. You can use them -- including sytax files -- for almost
every language you want.

<snip>

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

14. Re: Call for Opinions

cklester wrote:

> Juergen Luethje wrote:
>>
>> Thanks for this list, I like it.
>> I want to nominate
>> a) the Euphoria assembler
>> b) Matt's "32bits.zip", an almost indispensable patch for writing DLLs
>
> Where should I put those? :)

Next question, please ... smile

Hmm. Maybe the assembler is a category of its own, I'm not sure.
Concerning Matt's program, my personal opinion is that it belongs to the
category "Patches that overcome shortcomings in the current Eu version
and definitely should be officially included in the next Eu version".

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

15. Re: Call for Opinions

Juergen Luethje wrote:
> 
> Michael Raley wrote:
> 
> > Juergen Luethje wrote:
> 
> <snip>
> 
> >> Is the Crimson Editor written in Euphoria? If not, it IMHO shouldn't be
> >> mentioned on this list.
> >> If you want to make a list of editors that can be used to write Eu
> >> programs, this is a different topic, and such a list probably should
> >> contain 30 editors rather than one. smile
> >
> > Crimson is not a euphoria program, but if you load
> > the proper keywords and syntax files does that make it Euphoric?
> 
> Maybe. If so, this would also make a bunch of other editors Euphoric.
> So why only mention Crimson?
> And if they are not written in Euphoria, these programs should not be
> mentioned in a list of programs that are written in Euphoria. A proper
> category would be e.g. "General tool for writing programs", because
> Crimson, ConTEXT, etc.etc. do not provide anything that is *specific*
> for Euphoria. You can use them -- including sytax files -- for almost
> every language you want.
> 
> <snip>

Perhaps the solution is to point out the syntax files that people have
written.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

16. Re: Call for Opinions

cklester wrote:

> Thank you everybody for your input! The list is getting bigger and better. I'm
> going to try and keep the lists restricted to the "Top Ten," so get your vote
> in now if you haven't.

<snip>

As I see, the section "Custom EU Interpreters" is still empty ... blink
What IMHO would be really cool, is not a *list* of Custom EU Interpreters,
but a comparison table that shows which new features are implemented in
which interpreter.

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

17. Re: Call for Opinions

Juergen Luethje wrote:
> 
> As I see, the section "Custom EU Interpreters" is still empty ... blink
> What IMHO would be really cool, is not a *list* of Custom EU Interpreters,
> but a comparison table that shows which new features are implemented in
> which interpreter.

When you've got that done, send it to me! :)

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

18. Re: Call for Opinions

cklester wrote:
> 
> Juergen Luethje wrote:
> > 
> > As I see, the section "Custom EU Interpreters" is still empty ... blink
> > What IMHO would be really cool, is not a *list* of Custom EU Interpreters,
> > but a comparison table that shows which new features are implemented in
> > which interpreter.
> 
> When you've got that done, send it to me! :)
> 
> -=ck
> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
> 

There really is only 2 PD source custom interpreters to compare.
EG has not been improved, and is still built with the alpha source.

* Vincent's Enhanced Euphoria (VEEU) *Mine*
* Object Oriented Euphoria (OOEU) *Matt's*

It's kinda hard comparing apples against oranges. OOEU is designed to
incorperate OO into Euphoria, while VEEU is designed to have features that
Euphoria can use as a procedural language.


Regards,
Vincent

--
Without walls and fences, there is no need for Windows and Gates.

new topic     » goto parent     » topic index » view message » categorize

19. Re: Call for Opinions

Vincent wrote:
> 
> * Vincent's Enhanced Euphoria (VEEU) *Mine*
> * Object Oriented Euphoria (OOEU) *Matt's*
> 
> It's kinda hard comparing apples against oranges. OOEU is designed to
> incorperate OO
> into Euphoria, while VEEU is designed to have features that Euphoria can use
> as a procedural
> language.

Well, sorta.  It started as a project to create new features without having
to change the back end, i.e., by emitting il code differently.  OO was just
one thing that could be done that way (the continue statement is another).
Of course, we can't [yet?!] hook up our own il code to the real back end.

OOEU also has some other features, such as variable id's and an eval()
function.  It also allows binding, 'shrouding' and comes with an il
disassembler.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

20. Re: Call for Opinions

Matt Lewis wrote:
> 
> Vincent wrote:
> > 
> > * Vincent's Enhanced Euphoria (VEEU) *Mine*
> > * Object Oriented Euphoria (OOEU) *Matt's*
> > 
> > It's kinda hard comparing apples against oranges. OOEU is designed to
> > incorperate OO
> > into Euphoria, while VEEU is designed to have features that Euphoria can use
> > as a procedural
> > language.
> 
> Well, sorta.  It started as a project to create new features without having
> to change the back end, i.e., by emitting il code differently.  OO was just
> one thing that could be done that way (the continue statement is another).
> Of course, we can't [yet?!] hook up our own il code to the real back end.
> 
> OOEU also has some other features, such as variable id's and an eval()
> function.  It also allows binding, 'shrouding' and comes with an il
> disassembler.
> 
> Matt Lewis
> 

VEEU has "continue", variable_id, etc. I didnt add expression evaluation,
because I felt it added a considerable amount of extra overhead internally.
Binding/shrouding are on my todo list.

Regards,
Vincent

--
Without walls and fences, there is no need for Windows and Gates.

new topic     » goto parent     » topic index » view message » categorize

21. Re: Call for Opinions

cklester wrote:

> Juergen Luethje wrote:
>>
>> As I see, the section "Custom EU Interpreters" is still empty ... blink
>> What IMHO would be really cool, is not a *list* of Custom EU Interpreters,
>> but a comparison table that shows which new features are implemented in
>> which interpreter.
>
> When you've got that done, send it to me! :)

Now I know what a boomerang is. I should be more careful. smile

OK, I'll create a starting point:

===============================================================================
Custom Euphoria interpreters based on the open-source
Euphoria 2.5 interpreter offered by Rapid Deployment Software
(only free interpreters that come with the source code
 are mentioned)

 +  = yes
(+) = partly
 -  = no


General
=======

----------------+-----------------------------+-----------------------------+
                |  Object Oriented Euphoria   | Vincent's Enhanced Euphoria |
Name            |          (ooeu)             |          (veeu)             |
----------------+-----------------------------+-----------------------------+
Author          | Matt Lewis                  | Vincent Howell              |
----------------+-----------------------------+-----------------------------+
current version | 1.6.0                       |       ?                     |
----------------+-----------------------------+-----------------------------+
Download from   | http://www14.brinkster.com/ |http://www.rapideuphoria.com/|
(1 line!)       | matthewlewis/projects.html  |veeu.rar                     |
----------------+-----------------------------+-----------------------------+


Features
========

----------------+-----------------------------+-----------------------------+
platforms       | DOS, Win, Linux, FreeBSD    | DOS, Win, Linux, FreeBSD    |
----------------+-----------------------------+-----------------------------+
standalone EXE  |                             |                             |
file of the     |              +              |              +              |
interpreter     |                             |                             |
available       |                             |                             |
----------------+-----------------------------+-----------------------------+
structs         |              ?              |              +              |
----------------+-----------------------------+-----------------------------+
OOP             |              +              |              -              |
----------------+-----------------------------+-----------------------------+
enhanced name-  |              ?              |              +              |
space handling  |                             |                             |
----------------+-----------------------------+-----------------------------+
continue        |              +              |              +              |
----------------+-----------------------------+-----------------------------+
version()       |              ?              |              +              |
----------------+-----------------------------+-----------------------------+
var_id(),       |                             |                             |
read_var(),     |              +              |              +              |
write_var()     |                             |                             |
----------------+-----------------------------+-----------------------------+
block comments  |              ?              |              +              |
----------------+-----------------------------+-----------------------------+
compare sequen- |                             |                             |
ces using       |              -              |              +              |
(<,>,<=,>=,=,!=)|                             |                             |
----------------+-----------------------------+-----------------------------+
new basic       |              ?              |           boolean           |
data types      |                             |                             |
----------------+-----------------------------+-----------------------------+
eval()          |              +              |              -              |
----------------+-----------------------------+-----------------------------+
bind            |              +              |              -              |
----------------+-----------------------------+-----------------------------+
shroud          |              +              |              -              |
----------------+-----------------------------+-----------------------------+
disassambling   |              +              |              -              |
----------------+-----------------------------+-----------------------------+
convert to RDS- |             (+)             |              -              |
compatible code |                             |                             |
----------------+-----------------------------+-----------------------------+
===============================================================================


I apologize in advance for any mistake and omission. Maybe the authors
of the interpreters can correct and supplement the table.

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

22. Re: Call for Opinions

Matt Lewis wrote:

<snip>

> Well, sorta.  It started as a project to create new features without having
> to change the back end, i.e., by emitting il code differently.  OO was just
> one thing that could be done that way (the continue statement is another).
> Of course, we can't [yet?!] hook up our own il code to the real back end.
>
> OOEU also has some other features, such as variable id's and an eval()
> function.  It also allows binding, 'shrouding' and comes with an il
> disassembler.

BTW: I believe we can use OOEU as procedural language if we want,
     without using any OOP, and just use the other features.
     Is this right?

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

23. Re: Call for Opinions

Vincent wrote:

<snip>

> There really is only 2 PD source custom interpreters to compare.
> EG has not been improved, and is still built with the alpha source.
>
> * Vincent's Enhanced Euphoria (VEEU) *Mine*
> * Object Oriented Euphoria (OOEU) *Matt's*

That's the same what I found out in the meantime. smile

> It's kinda hard comparing apples against oranges. OOEU is designed to
> incorperate OO into Euphoria, while VEEU is designed to have features
> that Euphoria can use as a procedural language.

IMHO both interpreters *are* comparable. I alredy sent a draft of a
comparison table to this list. Depending on Topica's "health", it should
show up sooner or later.
Then please comment and correct the table!

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

24. Re: Call for Opinions

Juergen Luethje wrote:
> cklester wrote:
> > Juergen Luethje wrote:
> >> As I see, the section "Custom EU Interpreters" is still empty ... blink
> >> What IMHO would be really cool, is not a *list* of Custom EU Interpreters,
> >> but a comparison table that shows which new features are implemented in
> >> which interpreter.
> > When you've got that done, send it to me! :)
> Now I know what a boomerang is. I should be more careful. smile

LOL! You stepped up, though... Great job! I'll get that posted ASAP.

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

25. Re: Call for Opinions

Juergen Luethje wrote:
> 
> Matt Lewis wrote:
> 
> <snip>
> 
> > Well, sorta.  It started as a project to create new features without having
> > to change the back end, i.e., by emitting il code differently.  OO was just
> > one thing that could be done that way (the continue statement is another).
> > Of course, we can't [yet?!] hook up our own il code to the real back end.
> >
> > OOEU also has some other features, such as variable id's and an eval()
> > function.  It also allows binding, 'shrouding' and comes with an il
> > disassembler.
> 
> BTW: I believe we can use OOEU as procedural language if we want,
>      without using any OOP, and just use the other features.
>      Is this right?
> 

Yes.  In fact (and partially in response to your matrix), you could use
the OO features as structures (both in the logical and machine dependent,
c-structures).  Here's the start of a lib (and a simple demo) for doing that:

-----------------------------------------------------
-- begin cstructs.e
-- Structure library for OOEU
include machine.e

global euclass Byte( integer b )
	procedure Store( atom ptr )
		poke( ptr, this )
	end procedure
	
	function Fetch( atom ptr )
		return peek( ptr )
	end function
end euclass

global euclass Word( integer w )
	procedure Store( atom ptr )
		poke( ptr, and_bits( this, #FF ) )
		poke( ptr + 1, and_bits( this, #FF00 ) / #100 )
	end procedure
	
	function Fetch( atom ptr )
		return peek(ptr) + peek(ptr+1) * #100
	end function
	
	function sizeof()
		return 2
	end function
end euclass

global euclass Long( atom l )
    procedure Store( atom ptr )
        poke4( ptr, this )
    end procedure

    function Fetch( atom ptr )
        return peek4s( ptr )
    end function

    function sizeof()
        return 4
    end function
end euclass

global euclass DWord( Long d )

end euclass

global euclass ULong( Long u )
    function Fetch( atom ptr )
        return peek4u( ptr )
    end function
end euclass

global euclass UInt( ULong u )

end euclass

global euclass Int( Long i )

end euclass

global euclass Pointer( ULong p )
	
end euclass

global euclass Lpsz( sequence str )
    procedure Store( atom ptr )
        poke( ptr, this )
    end procedure

    function Fetch( atom ptr )
    	integer offset
    	offset = 0
    	while peek(ptr+offset) do
    		offset += 1
    	end while
    	if offset then
    		return peek( { ptr, offset })
    	else
    		return {}
    	end if
    end function
end euclass


global euclass CStruct( object c )
    atom ptr
    integer size
    function Alloc()
        return allocate( this.size )
    end function
    
    procedure Poke()
        
    end procedure

	function Peek()
		return this
    end function
end euclass
-- end cstructs.e
----------------------------------------------------------

----------------------------------------------------------
-- begin struct.ex
include cstructs.e

euclass MyStruct( CStruct s )
    Long a_long
    Lpsz a_string

    procedure Poke()
        atom ptr
        ptr = this.ptr
        this.a_long.Store( ptr )
        ptr += this.a_long.sizeof()
        this.a_string.Store( ptr )
    end procedure

    function Peek()
        atom ptr
        ptr = this.ptr
        this.a_long = this.a_long.Fetch( ptr )
        ptr += this.a_long.sizeof()
        this.a_string = this.a_string.Fetch( this.ptr )
        return this
    end function

    procedure New( atom l, sequence str )
        this = repeat( 0, MyStruct.a_string )
        this.size = Long.size + Lpsz.size
        this.ptr = this.Alloc()
        this.a_long = l
        this.a_string = str
        this.Poke()
    end procedure
end euclass

MyStruct struct

struct = MyStruct.New( 0, 0, "Hello, World" )
struct.Poke()
? struct
? peek( struct )
poke4u( struct.ptr, 1 )
struct = struct.Peek()
? struct

-- end struct.ex
---------------------------------------


new topic     » goto parent     » topic index » view message » categorize

26. Re: Call for Opinions

Juergen Luethje wrote:
> 
> ----------------+-----------------------------+-----------------------------+
>                 |  Object Oriented Euphoria   | Vincent's Enhanced Euphoria |
> Name            |          (ooeu)             |          (veeu)             |
> ----------------+-----------------------------+-----------------------------+
> Author          | Matt Lewis                  | Vincent Howell              |
> ----------------+-----------------------------+-----------------------------+
> current version | 1.6.0                       |       ?                     |
> ----------------+-----------------------------+-----------------------------+
> Download from   | <a
> href="http://www14.brinkster.com/">http://www14.brinkster.com/</a> |<a
> href="http://www.rapideuphoria.com/|">http://www.rapideuphoria.com/|</a>
> (1 line!)       | matthewlewis/projects.html  |veeu.rar                     |
> ----------------+-----------------------------+-----------------------------+

Matt, FYI, your brinkster page still refers to wxEuphoria 0.5.0...

-=ck
"Programming in a state of EUPHORIA."
http://www.cklester.com/euphoria/

new topic     » goto parent     » topic index » view message » categorize

27. Re: Call for Opinions

cklester wrote:
> 
> Matt, FYI, your brinkster page still refers to wxEuphoria 0.5.0...
> 

Oops, I'll have to update that page.  There are several things out of date,
including ooeu.  The correct url for that should be:

http://wxeuphoria.sourceforge.net/apps.htm

Matt Lewis

> "Programming in a state of EUPHORIA."
> <a
> href="http://www.cklester.com/euphoria/">http://www.cklester.com/euphoria/</a>
>

new topic     » goto parent     » topic index » view message » categorize

28. Re: Call for Opinions

Matt Lewis wrote:

> Juergen Luethje wrote:

<snip>

>> BTW: I believe we can use OOEU as procedural language if we want,
>>      without using any OOP, and just use the other features.
>>      Is this right?
>>
>
> Yes.  In fact (and partially in response to your matrix), you could use
> the OO features as structures (both in the logical and machine dependent,
> c-structures).  Here's the start of a lib (and a simple demo) for doing that:

Cool! Thanks.
Although I maybe slowly get a "feeling" for OOP, I wonder whether I ever
will actually understand it ...

> }}}
<eucode>
> -----------------------------------------------------
> -- begin cstructs.e
> -- Structure library for OOEU
> include machine.e
>
> global euclass Byte( integer b )
> 	procedure Store( atom ptr )
> 		poke( ptr, this )
                           ^^^^
... for instance, what does "this" mean.
I also saw it in OOEU example programs, but couldn't find an explanation.

<snip>

> ----------------------------------------------------------
> -- begin struct.ex
> include cstructs.e
>
> euclass MyStruct( CStruct s )
>     Long a_long
>     Lpsz a_string
>
>     procedure Poke()
>         atom ptr
>         ptr = this.ptr
>         this.a_long.Store( ptr )
>         ptr += this.a_long.sizeof()
>         this.a_string.Store( ptr )
>     end procedure
>
>     function Peek()
>         atom ptr
>         ptr = this.ptr
>         this.a_long = this.a_long.Fetch( ptr )
>         ptr += this.a_long.sizeof()
>         this.a_string = this.a_string.Fetch( this.ptr )
>         return this
>     end function
>
>     procedure New( atom l, sequence str )
>         this = repeat( 0, MyStruct.a_string )
>         this.size = Long.size + Lpsz.size
>         this.ptr = this.Alloc()
>         this.a_long = l
>         this.a_string = str
>         this.Poke()
>     end procedure
> end euclass
>
> MyStruct struct
>
> struct = MyStruct.New( 0, 0, "Hello, World" )

Another point that I don't understand:
'MyStruct.New()' is declared with 2 parameters, but here you call it
with 3 parameters ...

> struct.Poke()
> ? struct
> ? peek( struct )
> poke4u( struct.ptr, 1 )
> struct = struct.Peek()
> ? struct
>
> -- end struct.ex
> ---------------------------------------
> </eucode>
{{{


Thanks in advance for some help. smile
Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

29. Re: Call for Opinions

cklester wrote:

> Juergen Luethje wrote:

>>> When you've got that done, send it to me! :)
>> Now I know what a boomerang is. I should be more careful. smile
>
> LOL! You stepped up, though... Great job! I'll get that posted ASAP.

Thanks. But please wait until Matt and Vincent have corrected my
mistankes, and have replaced my '?' with the appropriate symbols.

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

30. Re: Call for Opinions

Juergen Luethje wrote:
> 
> Matt Lewis wrote:
> 
> > Juergen Luethje wrote:
> 
> <snip>
> 
> >> BTW: I believe we can use OOEU as procedural language if we want,
> >>      without using any OOP, and just use the other features.
> >>      Is this right?
> >>
> >
> > Yes.  In fact (and partially in response to your matrix), you could use
> > the OO features as structures (both in the logical and machine dependent,
> > c-structures).  Here's the start of a lib (and a simple demo) for doing
> > that:
> 
> Cool! Thanks.
> Although I maybe slowly get a "feeling" for OOP, I wonder whether I ever
> will actually understand it ...
> 
> > }}}
<eucode>
> > -----------------------------------------------------
> > -- begin cstructs.e
> > -- Structure library for OOEU
> > include machine.e
> >
> > global euclass Byte( integer b )
> > 	procedure Store( atom ptr )
> > 		poke( ptr, this )
>                            ^^^^
> ... for instance, what does "this" mean.
> I also saw it in OOEU example programs, but couldn't find an explanation.
> 
> <snip>
> 
> > ----------------------------------------------------------
> > -- begin struct.ex
> > include cstructs.e
> >
> > euclass MyStruct( CStruct s )
> >     Long a_long
> >     Lpsz a_string
> >
> >     procedure Poke()
> >         atom ptr
> >         ptr = this.ptr
> >         this.a_long.Store( ptr )
> >         ptr += this.a_long.sizeof()
> >         this.a_string.Store( ptr )
> >     end procedure
> >
> >     function Peek()
> >         atom ptr
> >         ptr = this.ptr
> >         this.a_long = this.a_long.Fetch( ptr )
> >         ptr += this.a_long.sizeof()
> >         this.a_string = this.a_string.Fetch( this.ptr )
> >         return this
> >     end function
> >
> >     procedure New( atom l, sequence str )
> >         this = repeat( 0, MyStruct.a_string )
> >         this.size = Long.size + Lpsz.size
> >         this.ptr = this.Alloc()
> >         this.a_long = l
> >         this.a_string = str
> >         this.Poke()
> >     end procedure
> > end euclass
> >
> > MyStruct struct
> >
> > struct = MyStruct.New( 0, 0, "Hello, World" )
> 
> Another point that I don't understand:
> 'MyStruct.New()' is declared with 2 parameters, but here you call it
> with 3 parameters ...
> 
> > struct.Poke()
> > ? struct
> > ? peek( struct )
> > poke4u( struct.ptr, 1 )
> > struct = struct.Peek()
> > ? struct
> >
> > -- end struct.ex
> > ---------------------------------------
> <font color="#330033">> </eucode>
{{{
</font>
> 
> Thanks in advance for some help. smile
> Regards,
>    Juergen
> 
> 

The structure library that I include with VEEU, can work on any 100% campatable
Euphoria interpreters.. And it also offers full support for C/C++ unions, arrays,
and all types. I had to modify it to work standalone without Chris's Empire
framework, plus did some other modifications & optimizations.

I'm planning on a binder/shrouder program.. and possibly an IL dissasembler for
the next release. Matt's interpreter has an GUI based trace screen module, that
is really cool. My next release will also have a better versioning system. Right
now it is just v2.5 (like Euphoria :P).

Regards,
Vincent

--
Without walls and fences, there is no need for Windows and Gates.

new topic     » goto parent     » topic index » view message » categorize

31. Re: Call for Opinions

Vincent wrote:

<snip>

> The structure library that I include with VEEU, can work on any 100%
> campatable Euphoria interpreters.. And it also offers full support for
> C/C++ unions, arrays, and all types. I had to modify it to work
> standalone without Chris's Empire framework, plus did some other
> modifications & optimizations.

I see.

> I'm planning on a binder/shrouder program.. and possibly an IL
> dissasembler for the next release. Matt's interpreter has an GUI based
> trace screen module, that is really cool. My next release will also
> have a better versioning system. Right now it is just v2.5 (like
> Euphoria :P).

I *did* read "2.5" in connection with VEEU, and I actually assumed that
this means the Euphoria version rather than the VEEU version. smile
It's nice to read, that you don't have completely moved to Java, and
that you are acetively developing VEEU.



CK, I'd like to suggest the following changes to the table.

According to a post by Matt yesterday, it should be now:
----------------+-----------------------------+-----------------------------+
structs         |              +              |              +              |
----------------+-----------------------------+-----------------------------+


And according to Vincent's post, we should change two rows to this ...
----------------+-----------------------------+-----------------------------+
current version | 1.6.0                       | 2.5                         |
----------------+-----------------------------+-----------------------------+
[...]
----------------+-----------------------------+-----------------------------+
RDS-compatible  |             (+)             |             (+)             |
code            |                             |                             |
----------------+-----------------------------+-----------------------------+


... and add something like this:
----------------+-----------------------------+-----------------------------+
GUI for tracing |              +              |              -              |
----------------+-----------------------------+-----------------------------+

Regards,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

32. Re: Call for Opinions

Juergen Luethje wrote:
> Cool! Thanks.
> Although I maybe slowly get a "feeling" for OOP, I wonder whether I ever
> will actually understand it ...

It's easy to understand, once you learn the intricies of Object Oriented
programming, such as your question below.

> ... for instance, what does "this" mean.
> I also saw it in OOEU example programs, but couldn't find an explanation.

It's quite simple.  The OOEu Interpreter, automatically inserts into the
variable space, a identifier called 'this'.  You can basically consider it
the way to refer to the object that your currently working with.  Though,
currently with Call Backs to your Euphoria Routine, does not return the
members associated with a EuClass, cause all the OOEu interpreter will have
is the variables passed by the caller function.  This is a small downfall.

> Another point that I don't understand:
> 'MyStruct.New()' is declared with 2 parameters, but here you call it
> with 3 parameters ...

Currently, with the way Constructors are setup, you have to pass a variable
space to initalize the Class Structure with.  Internally, it recognizes the
first parameter as being the instance of data to use, as the class, this is
how you can sub-class a variable, Such as:

object a a = 32
a = MyStruct.New(a,0,"Hello, World")
a.Store()


Even though 'a' is declared as a object, you can still associate it to a
EuClass through a constructor function on your EuClass.  This is sub-classing.
This is how OOEu identifies where the methods and members should be thrown,
basically.

Mario Steele
http://enchantedblade.trilake.net
Attaining World Dominiation, one byte at a time...

new topic     » goto parent     » topic index » view message » categorize

33. Re: Call for Opinions

Mario Steele wrote:
> 
> Juergen Luethje wrote:
> > Cool! Thanks.
> > Although I maybe slowly get a "feeling" for OOP, I wonder whether I ever
> > will actually understand it ...
> 
> It's easy to understand, once you learn the intricies of Object Oriented
> programming, such as your question below.
> 

I doubt OOEU offers a full fledged OOP solution. I give OOEU a thumbs up, but I
find Java and C# for example very challenging to learn the more newer advanced
OOP features like overloading, metadata, generics, etc. I mean I've already read
the OOP concepts in Java tuturial. But, hell it isnt all "candy & lollypops". But
sure, when I do finally understand it.. the experience would be like a hot knife
through butter. :P


Regards,
Vincent

--
Without walls and fences, there is no need for Windows and Gates.

new topic     » goto parent     » topic index » view message » categorize

34. Re: Call for Opinions

Vincent wrote:
> I doubt OOEU offers a full fledged OOP solution. I give OOEU a thumbs up, but
> I find Java
> and C# for example very challenging to learn the more newer advanced OOP
> features like
> overloading, metadata, generics, etc. I mean I've already read the OOP
> concepts in Java
> tuturial. But, hell it isnt all "candy & lollypops". But sure, when I do
> finally understand
> it.. the experience would be like a hot knife through butter. :P

Yes, .NET and Java offer great OO platforms. And OO is a great tool to use,
but it's not a perfect methodology. If you learn to use OO, don't make the
mistake to use OO just for the sake of OO. OO should be a tool, not a
purpose. You should use OO to facilitate programming, not the other way around.
It's easy to fall for the mistake, believe me, I've also made the mistake.

--
The Internet combines the excitement of typing 
with the reliability of anonymous hearsay.

tommy online: http://users.telenet.be/tommycarlier
tommy.blog: http://tommycarlier.blogspot.com

new topic     » goto parent     » topic index » view message » categorize

35. Re: Call for Opinions

Juergen Luethje wrote:
> 
> Matt Lewis wrote:
> >
> > global euclass Byte( integer b )
> > 	procedure Store( atom ptr )
> > 		poke( ptr, this )
>                            ^^^^
> ... for instance, what does "this" mean.
> I also saw it in OOEU example programs, but couldn't find an explanation.

Mario answered your questions, but I thought I'd give my 2cents, too.
OOP basically combines the concepts of data and program logic.  In this
case, the data is the object of yype Byte, and the program logic is
the procedure Byte::Store() (to use a C++-like notation).  So the program
logic should 'know' about the data.  Most OOP languages have an implicit
variable that you can refer to.  In ooeu, that variable is 'this'.  So 
assuming you have something like:
Byte b
-- ...
b.Store( ptr )

It's important that Byte::Store() know about 'b', and so it must be 
passed.  In the ooeu code, the b comes before the store, and dot notation
is used.  This is similar to how C++ handles it.  You can call C++ from
C or Euphoria (this is what I do in wxEuphoria or EuCOM, for instance),
but you have to explicitly pass as a parameter the object.

> > struct = MyStruct.New( 0, 0, "Hello, World" )
> 
> Another point that I don't understand:
> 'MyStruct.New()' is declared with 2 parameters, but here you call it
> with 3 parameters ...

Sometimes, you may want to call a method without having a real object,
like a constructor.  That's what you're looking at there.  Since there
may be more than one function named 'New', you have to let ooeu know
that you're interested in MyStruct.New().  However, MyStruct is the name
of the euclass, so where does the data come from?  In this case, ooeu
requires that you pass the 'this' parameter explicitly.  In the call above,
I'm not passing real data, because the whole point is to initialize the
object.  It's a somewhat kludgy way to go about this.  In the future, I'm 
planning on adding a more elegant solution, so that:
struct@New( 0, "Hello World" )
-- is equivalent to:
struct = MyStruct.New( 0, 0, "Hello World" )

-- and this:
struct~SomeMethod()
-- is equivalent to:
struct = struct.SomeMethod()


Hope that helps clear it up for you.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

36. Re: Call for Opinions

Vincent wrote:
> 
> I doubt OOEU offers a full fledged OOP solution. I give OOEU a thumbs up, but
> I find Java
> and C# for example very challenging to learn the more newer advanced OOP
> features like
> overloading, metadata, generics, etc. I mean I've already read the OOP
> concepts in Java
> tuturial. But, hell it isnt all "candy & lollypops". But sure, when I do
> finally understand
> it.. the experience would be like a hot knife through butter. :P
> 

No, it's a long way from C# or Java.  It's almost syntactic sugar, though I
think it offers a bit more than that.  I think it's possible (though not
easy) to turn Eu into a real OOP language, but one goal I have is to be
able to turn as much ooeu code into 'pure' eu code as possible.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

37. Re: Call for Opinions

On Sat, 21 May 2005 13:48:28 -0700, Matt Lewis
<guest at RapidEuphoria.com> wrote:

>In the future, I'm planning on adding a more elegant solution, so that:
>}}}
<eucode>
>struct@New( 0, "Hello World" )
>-- is equivalent to:
>struct = MyStruct.New( 0, 0, "Hello World" )
>
>-- and this:
>struct~SomeMethod()
>-- is equivalent to:
>struct = struct.SomeMethod()
></eucode>
{{{

Not to put too fine a point on it, I consider that horrid !!

Presumably, struct must be of type MyStruct anyway for the above to
work? So, please, what is wrong with:

	struct = New(0, "Hello World" )
	struct = SomeMethod()

Obviously, if struct is not of type MyStruct, then you need the
"MyStruct." qualifier to identify the class, but given that it is, you
can leave it (and that "this" thing) out?

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

38. Re: Call for Opinions

Pete Lomax wrote:
> Not to put too fine a point on it, I consider that horrid !!
> 
> Presumably, struct must be of type MyStruct anyway for the above to
> work? So, please, what is wrong with:
> 
> 	struct = New(0, "Hello World" )
> 	struct = SomeMethod()
> 
> Obviously, if struct is not of type MyStruct, then you need the
> "MyStruct." qualifier to identify the class, but given that it is, you
> can leave it (and that "this" thing) out?

Problem is Pete, yes, struct in that example is declared as MyStruct.  HOWEVER,
what about type-casting?

Example of Type Casting:
euclass MyClassA(sequence a)
    integer b, c, d
    function new()
        return repeat(0,3)
    end function
end euclass

euclass MyClassB(sequence b)
    integer a, d, e, f
    function new()
        return repeat(0,4)
    end function
end euclass

MyClassA MyNewVar

if platform() = 3 then
   MyNewVar = MyClassB.new({})
else
   MyNewVar = MyClassA.new({})
end if


If we went the way you suggest, then this would become obsolete, as sub-classing
couldn't be controled.  And we're back to having the same problem as we do now
with Regular Euphoria, as unable to dynamically include diffrent files, based on
platform, only in a Object refrence.

Mario Steele
http://enchantedblade.trilake.net
Attaining World Dominiation, one byte at a time...

new topic     » goto parent     » topic index » view message » categorize

39. Re: Call for Opinions

On Sat, 21 May 2005 20:09:30 -0700, Mario Steele
<guest at RapidEuphoria.com> wrote:

>Problem is Pete, yes, struct in that example is declared as MyStruct.  HOWEVER,
>what about type-casting?
Afaik, Eu does not have, need, or want type-casting.

>Example of Type Casting:
<snip>

>If we went the way you suggest, then this would become obsolete, as
>sub-classing
>couldn't be controled.
I don't understand, did you mean:.
if platform() = 3 then
   MyClassA MyNewVar
   MyNewVar@new({1,2,3})
else
   MyClassB MyNewVar
   MyNewVar@new({1,2,3,4})
end if

Why would @ be better than = ?

> And we're back to having the same problem as we do now
>with Regular Euphoria, as unable to dynamically include diffrent files, based
>on
>platform, only in a Object refrence.
I'm sure eu.ex can be modified to handle platform-dependent includes,
eg:
include.WIN32 file.exw
include.LINUX file.exu


If you are going to have platform-dependent classes, you'd need to
invent a similar scheme.

A better example might be:
class MyClass...
	WIN32.new(...
	LINUX.new(...
end class

function f(object a)
	a = new(blah,blah)
end function

MyClass MyNewVar

f(MyNewVar)

which brings me back to my original question, why would the above
scheme not work as well as a@new(blah,blah) would?

Pete

new topic     » goto parent     » topic index » view message » categorize

40. Re: Call for Opinions

Pete Lomax wrote:
> 
> On Sat, 21 May 2005 20:09:30 -0700, Mario Steele
> <guest at RapidEuphoria.com> wrote:
> 
> >Problem is Pete, yes, struct in that example is declared as MyStruct. 
> >HOWEVER,
> >what about type-casting?
> Afaik, Eu does not have, need, or want type-casting.

Correct, standard, RDS Eu does not.  However, type-casting can become 
important in an OOP setting.  Mario brings up the case of sub-classing, but
I think a better example would be when you want to treat some arbitrary 
piece of data as an object of some class that you've defined.

In OOEU, you can declare variables as a class' type.  The interpreter then
knows some things about it, and knows that there are certain functions
that go with it.  But what if you have a regular sequence or something,
and want to use it as a class object?  Then you need to be able to cast
it as such.

> >Example of Type Casting:
> <snip>
> 
> >If we went the way you suggest, then this would become obsolete, as
> >sub-classing
> >couldn't be controled.
> I don't understand, did you mean:.
> }}}
<eucode>
> if platform() = 3 then
>    MyClassA MyNewVar
>    MyNewVar@new({1,2,3})
> else
>    MyClassB MyNewVar
>    MyNewVar@new({1,2,3,4})
> end if
> </eucode>
{{{
</font>
> Why would @ be better than = ?

I think he's talking about having MyClassA, which derives from MyClassB.
There could be a case where you'd want to call some routine from MyClassB
that was overridden in MyClassA.  The point of the '@' is to give ooeu a
pseudo PBR type ability.  The point is that you're constructing the object,
so it has no value.  You can't pass it to the function, and the function is
going to give it it's value, so there's not really any point in passing 
something else as a proxy, so let the interpreter pass some default, dummy
value.


Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

41. Re: Call for Opinions

Matt Lewis wrote:

> Juergen Luethje wrote:
>>
>> Matt Lewis wrote:
>>>
>>> global euclass Byte( integer b )
>>> 	procedure Store( atom ptr )
>>> 		poke( ptr, this )
>>                         ^^^^
>> ... for instance, what does "this" mean.
>> I also saw it in OOEU example programs, but couldn't find an explanation.
>
> Mario answered your questions, but I thought I'd give my 2cents, too.

Thanks to you and Mario, and all others who posted helpful hints here.
I'll consider your warning, Tommy.

> OOP basically combines the concepts of data and program logic.  In this
> case, the data is the object of yype Byte, and the program logic is
> the procedure Byte::Store() (to use a C++-like notation).  So the program
> logic should 'know' about the data.  Most OOP languages have an implicit
> variable that you can refer to.  In ooeu, that variable is 'this'.  So
> assuming you have something like:
> }}}
<eucode>
> Byte b
> -- ...
> b.Store( ptr )
> </eucode>
{{{

> It's important that Byte::Store() know about 'b', and so it must be
> passed.  In the ooeu code, the b comes before the store, and dot notation
> is used.  This is similar to how C++ handles it.  You can call C++ from
> C or Euphoria (this is what I do in wxEuphoria or EuCOM, for instance),
> but you have to explicitly pass as a parameter the object.

In the code snippet above, the parameter 'b' is never used. But this is
the value that should be stored, isn't it? From a "procedural point of
view", then I'd like to write:
   poke( ptr, b )
but you wrote
   poke( ptr, this )

So is 'this' identical to 'b' in this case? If so, could we actually
write 'b' rather than 'this'?

>>> struct = MyStruct.New( 0, 0, "Hello, World" )
>>
>> Another point that I don't understand:
>> 'MyStruct.New()' is declared with 2 parameters, but here you call it
>> with 3 parameters ...
>
> Sometimes, you may want to call a method without having a real object,
> like a constructor.  That's what you're looking at there.  Since there
> may be more than one function named 'New', you have to let ooeu know
> that you're interested in MyStruct.New().

OK. smile

> However, MyStruct is the name
> of the euclass, so where does the data come from?  In this case, ooeu
> requires that you pass the 'this' parameter explicitly.  In the call above,
> I'm not passing real data, because the whole point is to initialize the
> object.

In other words: One parameter (the first?) is passed to the class 'MyStruct',
and the other two are passed to its method 'New'?

> It's a somewhat kludgy way to go about this.  In the future, I'm
> planning on adding a more elegant solution, so that:
> }}}
<eucode>
> struct@New( 0, "Hello World" )
> -- is equivalent to:
> struct = MyStruct.New( 0, 0, "Hello World" )
>
> -- and this:
> struct~SomeMethod()
> -- is equivalent to:
> struct = struct.SomeMethod()
> </eucode>
{{{

>
> Hope that helps clear it up for you.

I probably should look into a OOP tutorial for beginners, preferably in
German. The problem is, that this will not tell me how things are
concrete done in OOEU.

Thanks,
   Juergen

new topic     » goto parent     » topic index » view message » categorize

42. Re: Call for Opinions

Juergen Luethje wrote:
> 
> Matt Lewis wrote:
> 
> > Juergen Luethje wrote:
> >>
> >> Matt Lewis wrote:
> >>>
> >>> global euclass Byte( integer b )
> >>> 	procedure Store( atom ptr )
> >>> 		poke( ptr, this )
> >>                         ^^^^
> >> ... for instance, what does "this" mean.
> >> I also saw it in OOEU example programs, but couldn't find an explanation.

<snip>

> > }}}
<eucode>
> > Byte b
> > -- ...
> > b.Store( ptr )
> <font color="#330033">> </eucode>
{{{
</font>
> > It's important that Byte::Store() know about 'b', and so it must be
> > passed.  In the ooeu code, the b comes before the store, and dot notation
> > is used.  This is similar to how C++ handles it.  You can call C++ from
> > C or Euphoria (this is what I do in wxEuphoria or EuCOM, for instance),
> > but you have to explicitly pass as a parameter the object.
> 
> In the code snippet above, the parameter 'b' is never used. But this is
> the value that should be stored, isn't it? From a "procedural point of
> view", then I'd like to write:
>    poke( ptr, b )
> but you wrote
>    poke( ptr, this )
>
> So is 'this' identical to 'b' in this case? If so, could we actually
> write 'b' rather than 'this'?

There are actually two 'b's in the code.  One is in the class definition,
and the other is the actual, instantiated Byte.  The name in the class
definition is basically ignored, but it needs to be there.  The class
definition is like a type definition.  You have to declare a data type,
so that ooeu knows what type of data you're using, and if the class is
derived from another class.  If it is derived, then the data type is 
the name of the class from which it is derived.

When you actually call Byte::Store(), Byte::Store() has no concept, of
course, of the name of the variable that is being used in the call.
The 'this' is just implicitly there for all class methods.  In the case
of Byte, it is just an integer (in theory, you could add type checking to
it by declaring a byte type and using that for the base data type).
In order to store the byte, you call its Store() method.

I suppose that it could be possible to use the name as declared in the
class definition, but I think it's clearer to use 'this', because no 
matter which class you're looking at, you always know what 'this' means.
 
> >>> struct = MyStruct.New( 0, 0, "Hello, World" )
> >>
> >> Another point that I don't understand:
> >> 'MyStruct.New()' is declared with 2 parameters, but here you call it
> >> with 3 parameters ...
> >
> > Sometimes, you may want to call a method without having a real object,
> > like a constructor.  That's what you're looking at there.  Since there
> > may be more than one function named 'New', you have to let ooeu know
> > that you're interested in MyStruct.New().
> 
> OK. smile
> 
> > However, MyStruct is the name
> > of the euclass, so where does the data come from?  In this case, ooeu
> > requires that you pass the 'this' parameter explicitly.  In the call above,
> > I'm not passing real data, because the whole point is to initialize the
> > object.
> 
> In other words: One parameter (the first?) is passed to the class 'MyStruct',
> and the other two are passed to its method 'New'?

No, all parameters are passed to the 'New' method.  Using the class name
is sort of like using namespaces, with the added caveat that you have to
explicitly pass the value for 'this'.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

43. Re: Call for Opinions

Juergen Luethje wrote:
> 
> Matt Lewis wrote:
> 
> > Juergen Luethje wrote:
> >>
> >> Matt Lewis wrote:
> >>>
> >>> global euclass Byte( integer b )
> >>> 	procedure Store( atom ptr )
> >>> 		poke( ptr, this )
> >>                         ^^^^
> >> ... for instance, what does "this" mean.
> >> I also saw it in OOEU example programs, but couldn't find an explanation.
> >
> > Mario answered your questions, but I thought I'd give my 2cents, too.
> 
> Thanks to you and Mario, and all others who posted helpful hints here.
> I'll consider your warning, Tommy.
> 
> > OOP basically combines the concepts of data and program logic.  In this
> > case, the data is the object of yype Byte, and the program logic is
> > the procedure Byte::Store() (to use a C++-like notation).  So the program
> > logic should 'know' about the data.  Most OOP languages have an implicit
> > variable that you can refer to.  In ooeu, that variable is 'this'.  So
> > assuming you have something like:
> > }}}
<eucode>
> > Byte b
> > -- ...
> > b.Store( ptr )
> <font color="#330033">> </eucode>
{{{
</font>
> > It's important that Byte::Store() know about 'b', and so it must be
> > passed.  In the ooeu code, the b comes before the store, and dot notation
> > is used.  This is similar to how C++ handles it.  You can call C++ from
> > C or Euphoria (this is what I do in wxEuphoria or EuCOM, for instance),
> > but you have to explicitly pass as a parameter the object.
> 
> In the code snippet above, the parameter 'b' is never used. But this is
> the value that should be stored, isn't it? From a "procedural point of
> view", then I'd like to write:
>    poke( ptr, b )
> but you wrote
>    poke( ptr, this )
> 
> So is 'this' identical to 'b' in this case? If so, could we actually
> write 'b' rather than 'this'?
> 
> >>> struct = MyStruct.New( 0, 0, "Hello, World" )
> >>
> >> Another point that I don't understand:
> >> 'MyStruct.New()' is declared with 2 parameters, but here you call it
> >> with 3 parameters ...
> >
> > Sometimes, you may want to call a method without having a real object,
> > like a constructor.  That's what you're looking at there.  Since there
> > may be more than one function named 'New', you have to let ooeu know
> > that you're interested in MyStruct.New().
> 
> OK. smile
> 
> > However, MyStruct is the name
> > of the euclass, so where does the data come from?  In this case, ooeu
> > requires that you pass the 'this' parameter explicitly.  In the call above,
> > I'm not passing real data, because the whole point is to initialize the
> > object.
> 
> In other words: One parameter (the first?) is passed to the class 'MyStruct',
> and the other two are passed to its method 'New'?
> 
> > It's a somewhat kludgy way to go about this.  In the future, I'm
> > planning on adding a more elegant solution, so that:
> > }}}
<eucode>
> > struct@New( 0, "Hello World" )
> > -- is equivalent to:
> > struct = MyStruct.New( 0, 0, "Hello World" )
> >
> > -- and this:
> > struct~SomeMethod()
> > -- is equivalent to:
> > struct = struct.SomeMethod()
> <font color="#330033">> </eucode>
{{{
</font>
> >
> > Hope that helps clear it up for you.
> 
> I probably should look into a OOP tutorial for beginners, preferably in
> German. The problem is, that this will not tell me how things are
> concrete done in OOEU.
> 
> Thanks,
>    Juergen
> 
> 


I think Euphoria is just fine as a procedural language. With threads and a few
other language improvements, Euphoria would be fine. OOP is cool in modified
interpreters, but I would not like it in official Euphoria, and would probably
move completely away from the language if it did happen.

Regards,
Vincent

--
Without walls and fences, there is no need for Windows and Gates.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu