Re: pass by ref
- Posted by ghaberek (admin) Sep 03, 2015
- 2374 views
xecronix said...
I did change a small bit of your dude Class like code. Check it out! :)
Looks good. I would make a few more changes:
- make the Dude type public so you can use it elsewhere
- allow the Dude type to accept NULL for empty objects
- update your main() routine to use the Dude type
constant NULL = 0 -- Awesome Euphoria Feature! Let's define what a dude looks like. public type Dude (atom ptr) return equal(ptr, NULL) or equal(eumem:ram_space[ptr][__TYPE__], DUDE_ID) end type procedure main() Dude my_dude = dude:new( "John", "Smith", 32 ) display( "[] [] is []", { get_fname( my_dude ), get_lname( my_dude ), get_age( my_dude ) } ) maybe_any_key() end procedure
-Greg