![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Jeff,
I think you want to use
P1 ADDR P2 ADD
I usually use late binding in the definition of ADD so that P1 can be
any class.
Gene
On 17 Sep 2003 at 14:42, Jeff Massung wrote:
Date sent: Wed, 17 Sep 2003 14:42:42 -0600
From: Jeff Massung <jma_at_mfire.com>
To: <sftalk_at_forth.com>
Subject: [sftalk] Calling class methods within a class
Send reply to: sftalk_at_forth.com
> I can't seem to find a way of calling another object's class methods from=
>
> within the method of the current class. For example, using the general PO=
> INT
> class that is in the documentation, I'd like to add a ADD method:
>
> : add ( p1 p2 -- x' y' ) { todo } ;
>
> =46rom here, I would be able to do the following:
>
> POINT builds p1
> POINT builds p2
>
> { setup values }
>
> p1 p2 add . .
>
> With p1 on the stack, making reference to a method just calls p2's method=
> , and
> using -> or CALLING doesn't work either. Any and all ideas appreciated.
>
> As always, sorry about the formatting...
>
> Jeff
>
>
> jma_at_mfire.com
> http://www.simforth.com
>
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and bug
> reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Sep 17 2003 - 14:44:39 PDT
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:33 PST