Hi Christophe,

I think your description is incomplete. By privatization do you mean 

1. that functions within the object should/should not have access to the
privatized function? 

2. If 1, then that limits how hidden the hidden function is. Recall that
REBOL functions are editable during runtime. This means that I can use
any function that accesses the hidden function as an entry point into
the hidden function. I.e.

o: make object! [
 hidden-func: does []
 exposed-func: does [hidden-func]
]

exposed-hidden-func: get first second get in o 'exposed-func

3. Should the function have access to other functions and words defined
in the context of the object?
4. Should the object be serializable including hidden functions?

5. Should descendants have access to hidden functions?

Without clarifying these questions I can see a long thread of rejected
proposals.

Take Care,

Elan



"CRS - Psy Sel/SPO, COUSSEMENT Christophe, CPN" wrote:
> 
> Hi REBOLS,
> 
> I would like to make an object function private to this object. That is:
> 
> >> o: make object! [
> [    value: make integer! 1
> [    ; some privatization code ...
> [    add-one: does [value: value + 1]
> [    get-value: does [add-one
> [        print value]
> [    ]
> >> o/get-value
> 2
> >> o/add-one
> 
> here I should get something like...
> 
> ** Script Error: Invalid path value: add-one.
> ** Where: o/add-one
> 
> Any idea ? Of course the principle could be extended to the privatization of
> variables...
> 
> Thx a lot,
> 
> Best Regards,
> 
> chr==
> 
> --
> 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