Hi Gabriele,

how is this any ifferent from what you can do with the current stable
version (2.3)? 
The questions, however, remain. 
a) The protection can be circumvented, in as much as I can use
get-value's body to access add-one as well as value.
b) The object o cannot be serialized together with the hidden words.

BTW, Christoph, what are you trying to accomplish?

Take Care,

Elan

I can still access "private" 

Gabriele Santilli wrote:
> 
> Hello COUSSEMENT Christoph!
> 
> On 15-Gen-01, you wrote:
> 
>  CC>>> o/add-one
> 
>  CC> here I should get something like...
> 
>  CC> ** Script Error: Invalid path value: add-one.
>  CC> ** Where: o/add-one
> 
> The most recent /Core experimental allows you to write:
> 
>   o: make object! [
>     ; public
>     get-value: none
>     ; private
>     make object! [
>       value: make integer! 1
>       add-one: does [value: value + 1]
>       set 'get-value does [
>         add-one
>         print value
>       ]
>     ]
>   ]
> 
> or:
> 
>   o: make object! [
>     ; public
>     get-value: none
>     ; private
>     use [value add-one] [
>       value: make integer! 1
>       add-one: does [value: value + 1]
>       get-value: does [
>         add-one
>         print value
>       ]
>     ]
>   ]
> 
> Regards,
>     Gabriele.
> --
> Gabriele Santilli <[EMAIL PROTECTED]> - Amigan - REBOL programmer
> Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/
> 
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to