Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Private Object Function

From: coussement:c:itc:mil:be at: 16-Jan-2001 9:56

> 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 > ] > ] > ]
[thanks for answering ! it works fine to me, but it does not simplify and clarify the writing of the code, in that way that the body of the 'public function' must be found back into the 'private' part, due to the runtime binding... Anyway, it's my best solution for now ;-) best regards, chr== ]