Hi Alberto,
As Gregg said Rebol was designed for smaller projects so there is not much
needs for full featured OOP. But I think such 'protected' feature can be
easily replaced by simple rule (which can be applied even inside a group of
developers which are working on the same project):
-Use specific names for private members. For example:
my-obj: context [
p_a: 10
p_b: 20
c: 30
d: 40
....
etc.
]
so this way programmer knows what member of object is allowed to change. It
all depends on the team/author discipline ;)
>From my exeprience I've never had problems with errors of this kind in Rebol
projects (even though I worked also in strict OOP language based projects)
but this is just my 2cents. Maybe there is lot of people who rely on this
kind of 'error checking'.
regards,
Cyphre
----- Original Message -----
From: "Alberto" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 05, 2006 6:35 PM
Subject: [REBOL] Re: Private words in objects?
>
> 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.
>
--
To unsubscribe from the list, just send an email to
lists at rebol.com with unsubscribe as the subject.