Jump to content

Send an unknown method call: Difference between revisions

Line 156:
var x \ instantiate a class var object named x
 
\ Use a standard Forth string and evaluate it.
: test
\ This is equivalent to sending the !: message to object x
heap> string locals| s |
42 x s" !:" evaluate
'!' s +: ':' s +: \ build the message "!:" into string s
 
42 x s @: evaluate \ retrieve the text from s and execute it
x p: ;42 \ lastly, \ send the print message ( p: message) to x to printverify the contents it
 
test \ => 42 ok
</lang>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.