Hi, Elan,

> Hi Tim,
>
> hiding words in REBOL is independent of objects and facilitated
by the 'use
> context. The 'use context can be used in objects.
>
> The 'use native is used to create a context in which words are
hidden:
>
> use [ a b c ] [
>   a: 1
>   b: 2
>   c: 3
> ]
>
>
> object: make object! [
>   a: none
>   b: none
>   use [a b] [
>     a: "this is the hidden a"
>     b: "this is the hidden b"
>   ]
> ]
>
> If we probe the object we find that the words in the use context
are not
> exposed:
>
> >> probe object
>
> make object! [
> a: none
> b: none
> ]
>
>
>
> At 09:20 AM 5/24/00 -0800, you wrote:
> >I am presently reviewing a presentation on rebol
> >made by a third party. It is good to see that rebol
> >is getting some exposure.
> >
> >I need to verify something stated in this presentation:
> >Can there be "hidden variables" in a rebol object.
> >
> >I.E. would these by like private variables/methods
> >in C++;
> >
> >I'd appreciate the informed word on this.
> >
> >Thanks
> >Tim
> >
> >
> >
>
> ;- Elan >> [: - )]


The problem with the hidden variables:

object: make object! [
   a: none
   b: none
   hiddena: none
   use [a b] [
     a: "this is the hidden a"
     b: "this is the hidden b"
     hiddena: func [] [a]
   ]
 ]

is, that the "hidden a" is nor really hidden, neither protected,
as can be easily seen:

set first second get in object 'hiddena "not protected"
>> object/hiddena
== "not protected"

Any opinions?

    Ladislav


Reply via email to