Tim Lesher:
> Some of the Rebol documentation mentions "hidden" object values, and says
to see the Rebol user's guide for more information.  However, looking at the
/core user's guide (2.2.0), I can't find any mention of how to make a hidden
object value.  Is this possible, and if so, how?

Here's some stuff you might not know about objects:
>> o: make object! [
[    A: 1
[    B: 2
[    C: 3
[    ]
>> first o
== [self A B C]
>> second o
== [
    make object! [
        A: 1
        B: 2
        C: 3
    ] 1 2 3]

By using 'first and 'second, you can access parts of the object.

For hiding stuff in objects, you can use a technique like this:

>> oh/f
** Script Error: Invalid path value: f.
** Where: oh/f
>> oh: make object! [
[    F: none
[    use [A B] [
[        A: "AAAA"
[        B: "BBBB"
[        set 'F func [] [print [A B]]
[        ]
[    ]
>> probe oh

make object! [
    F: func [][print [A B]]
]
>> oh/f
AAAA BBBB

BUT! The first use of 'recycle (or allowing the Rebol Garbage Collector to
function) and then issuing:

>> oh/f

crashes Rebol. Which is annoying. :-(

Andrew Martin
Environmentally sound Rebol...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-


Reply via email to