1. OOP example
- Posted by dstanger at belco.bc.ca May 30, 2002
- 454 views
Thank you for answering my questions about OOP. Your example: call_proc(foo[talk], {}) What was the code that led up to this point? I understand that foo is a class (a combination of a routine and variables as you explained) and talk is the routine within it but how did you "make" the class? I am having some trouble understanding because this is an area of Euphoria that I haven't explored yet. Thanks, David S.
2. Re: OOP example
- Posted by jbrown105 at speedymail.org May 31, 2002
- 423 views
On 0, dstanger at belco.bc.ca wrote: > > Thank you for answering my OOP questions. > > I just had a breakthrough regarding classes. I had understood the concept of > a class being variables and routine in one but I could not wrap my brain > around how to create a class. Now I think that I figured it out: > > constant TALK = 1 > > procedure talk(sequence s) > puts(1, s) > end procedure > > integer i > i = routine_id("talk") > > sequence foo > foo = {i} > > call_proc(foo[TALK], {"Hello World!"}) > > Is this how you arrived at the first example in your post? > > David S. > 100% correct. You could also emulate variables: constant TALK = 1, HELLO = 2 procedure talk(sequence s) puts(1, s) end procedure integer i i = routine_id("talk") sequence foo foo = {i, "Hellow World!"} call_proc(foo[TALK], {foo[HELLO]}) jbrown -- http://fastmail.fm/ - Access your email from home and the web