Hello [EMAIL PROTECTED]!
On 27-Mag-00, you wrote:
w> Now for some mysterious stuff:
w> x: make object! [self: make self [a: 1 b: 2] c: 3 d: 4]
w> What do you suppose is happening here? :-) It's a little
w> mystery. (-:
Looking at the result of:
>> obj: make object! [self: 3]
== 3
I assume that the code above is rougly equivalent to:
use [c d] [
c: 3 d: 4
x: make object! [
a: 1 b: 2 c: 3 d: 4
]
]
(The difference is subtle; I'll leave it as a puzzle for the
reader. :-) )
A more readable version of the above is:
make object! [
set 'x make self [
a: 1 b: 2
]
c: 3 d: 4
]
Being C and D duplicated in the "inner" object, using them as
hidden variables may be tricky; surely that would make someone
who's PROBEing the object to see how it works go crazy. :-)
Regards,
Gabriele.
--
Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer
Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
- [REBOL] [REBOL]hidden variables in objects? Re:(3) giesse
- [REBOL] [REBOL]hidden variables in objects? Re:(4) tim
- [REBOL] [REBOL]hidden variables in objects? Re:(... lmecir
- [REBOL] hidden variables in objects? Re:(6) brian . hawley
- [REBOL] hidden variables in objects? Re:(6) giesse
- [REBOL] hidden variables in objects? Re:(7) carl
- [REBOL] hidden variables in objects? Re:(8) tim
- [REBOL] hidden variables in objects? Re:(8) Petr . Krenzelok
- [REBOL] Re: hidden variables in objects? Re:(7) giesse
- [REBOL] hidden variables in objects? Re:(9) whip
- [REBOL] hidden variables in objects? Re:(11) giesse
- [REBOL] hidden variables in objects? Re:(11) whip
- [REBOL] hidden variables in objects? Re:(12) larry
- [REBOL] hidden variables in objects? Re:(13) whip
- [REBOL] hidden variables in objects? Re:(12) giesse
- [REBOL] hidden variables in objects? Re:(13) whip
- [REBOL] hidden variables in objects? Re:(14) icimjs
- [REBOL] hidden variables in objects? Re:(15) lmecir
- [REBOL] hidden variables in objects? Re:(16) icimjs
- [REBOL] hidden variables in objects? Re:(17) lmecir
- [REBOL] hidden variables in objects? Re:(17) giesse
