Using the name of objects

From: Cees van Zeeland <cees.van.zeeland_at_xs4all.nl>
Date: Sun, 26 Nov 2006 12:58:35 +0100

Hi,

I would like to use the name of an object.
Something like:

Class ExampleClass1

    : .ObjName
        self 3 cells - @ >name count type ;

end-class

ExampleClass1 builds foo1

foo1 .ObjName

Although this works, for indexed object one needs to use something like:

Class ExampleClass2

    : .ObjName
        self 4 cells - @ >name count type ;

end-class

6 ExampleClass2 builds[] foo2

3 foo2 .ObjName

Non of these versions work in the next construction.

: Bar
    [objects ExampleClass1 makes foo3 objects]
    foo3 .ObjName ;

Bar

Is the name non-existent with local objects?
Any suggestion would be fine.

Cees van Zeeland

----------------------------------------------------------------------
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 Sun Nov 26 2006 - 03:59:09 PST


Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!

This archive was generated 09-Feb-2012. Archive updated nightly.