Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: How does th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 12 Topic 3967 of 4053
Post > Topic >>

Re: How does this Mini-OOF thing work, again?

by Gerry <gerry@[EMAIL PROTECTED] > Mar 24, 2008 at 02:39 PM

On 24 Mar, 20:20, Bruce McFarling <agil...@[EMAIL PROTECTED]
> wrote:

> However when I try:
>
> include mini-oof.fs
>
> object class
> method actor ( o -- )
> method test$ ( o -- ca u )
> end-class test-object
>
> :noname ( o -- ) test$ CR TYPE ; test-object defines actor
> :noname ( o -- ca u ) DROP S" Testing." ; test-object defines test$
>
> : Testing ( -- ) test-object actor ;
> Testing
>
> I get an invalid memory address in Testing, in actor, when it does a
> @[EMAIL PROTECTED]
>
That's because test-object is a class and you need an object of that
class on the stack before you call one of its methods. So you need to
do
   test-object new
somewhere

If you try

test-object new constant xyz
xyz actor

should work.

Gerry




 12 Posts in Topic:
How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 13:20:36 
Re: How does this Mini-OOF thing work, again?
anton@[EMAIL PROTECTED]   2008-03-24 21:00:03 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 14:16:09 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 14:17:07 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 14:23:58 
Re: How does this Mini-OOF thing work, again?
Bernd Paysan <bernd.pa  2008-03-24 22:40:16 
Re: How does this Mini-OOF thing work, again?
Gerry <gerry@[EMAIL PR  2008-03-24 14:39:35 
Re: How does this Mini-OOF thing work, again?
jacko <jackokring@[EMA  2008-03-24 15:16:15 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-24 15:17:13 
Re: How does this Mini-OOF thing work, again?
Gerry <gerry@[EMAIL PR  2008-03-25 02:36:34 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-25 09:33:52 
Re: How does this Mini-OOF thing work, again?
Bruce McFarling <agila  2008-03-25 11:05:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri May 16 10:47:22 CDT 2008.