Hi Ladislav,

>>
>>
> For protected variables see the PROTECT function.
>
> -Ladislav
>

Yes, you are right.
But you didn't understand my question, but  was MY FAULT because I mixed
terminology used in oop with terminology used in rebol programing.
Sorry for That.


When I said "protected" variables I mean:
(using oop terminology)

        a property that is read-only for the "client" (normal code),
        but is read/write for methods (code inside the class/object)

If I could write it in rebol (hypothetical code) would be:

obj: make object! [
        field: 0
        protect-this 'field ;; **** NOT REBOL CODE: pretect only for client
        inc-field: func [][field: field + 1]
]

Now, if you write

        >> obj/inc-field
        >> obj/field
        == 1

'field was incremented
but

        >> obj/field: 0

Would throw an error, because obj/field is protected to the "client" code

Ciao
--
alberto
-- 
To unsubscribe from the list, just send an email to 
lists at rebol.com with unsubscribe as the subject.

Reply via email to