Hi list,
A brief question about objects.fs, my favourite OO
package in Forth.
I have succesfully tried to catch exception within
methods, but how about catching calls to a [parent]
method as in the following code. Is that possible ?
Best regards
Rafael
include objects.fs
\ a class which throw exceptions
object class
public
m: ( this -- )
-90 throw
." Hello world !" cr
;m
method foo1
end-class foo
\ a class which do not catch exceptions
object class
cell% inst-var m-fooref \ ptr to a foo object
public
selector bar1
m: ( ptr this --)
m-fooref !
;m
overrides construct
m: ( this --)
m-fooref @ foo1
;m
overrides bar1
end-class bar
\ a refined class who should wrap its parent class'
\ methods with a catch
bar class
public
m: ( ptr this --)
this [parent] construct
;m
overrides construct
m: ( this --)
this [parent] bar1 \ How do I catch this ?
;m
overrides bar1
end-class gbar
foo heap-new constant myfoo
myfoo bar heap-new constant mybar
myfoo gbar heap-new constant mybar2
mybar2 bar1
______________________________________________
Web Revelación Yahoo! 2007:
Premio Favorita del Público.
http://es.promotions.yahoo.com/revelacion2007/favoritos/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]