[REBOL] Hidden object values? Re:(2)

2000-06-19 Thread leshert

This is a very cool technique.  Is it documented, or are we in the realm of
"oral tradition"?

-- 
Tim Lesher
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 16, 2000 17:21
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [REBOL] Hidden object values? Re:


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: ""
[B: ""
[set 'F func [] [print [A B]]
[]
[]
>> probe oh

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

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/
-><-




[REBOL] Hidden object values? Re:

2000-06-16 Thread bhandley

> 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.

Can I rely on this not changing? Is this a stable part of rebol?




[REBOL] Hidden object values? Re:

2000-06-16 Thread Al . Bri

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: ""
[B: ""
[set 'F func [] [print [A B]]
[]
[]
>> probe oh

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

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/
-><-