[REBOL] Re: Private words in objects?
From: alberto:origen:mx at: 5-Jul-2006 11:35
> For protected variables see the PROTECT function.
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! [
protect-this 'field ;; **** NOT REBOL CODE: pretect only for client
inc-field: func [field: field + 1]
Now, if you write
'field was incremented
>> obj/field: 0
Would throw an error, because obj/field is protected to the "client" code