Hi, Ingo.
Caution - none of this works as expected.
Implementation: make object! [
s: "This is s - a string"
f: func [hello] [s]
]
Interface: make object! [
; f: get in Implementation 'f ; Copies Implementation/f
; f: func [] [Implementation/f] ; Not nice, boring.
; f: func first get in Implementation 'f
; second get in Implementation 'f Copy.
f: implement in Implementation 'f ; make a word which points to
another word to execute.
f: redirect in Implementation 'f ; make a word which points to another
word to execute.
]
; Something like this in REBOL would be nice:
C!: make class! [
s: "a string"
m: method [parameter] [s]
]
Cc: make C! [
m: overide method [blah] [join s blah]
]
Andrew Martin
Dreaming of wide open spaces...
[EMAIL PROTECTED]
http://members.xoom.com/AndrewMartin/
Online @ 33,600 Baud!
-><-
----------
> From: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: [REBOL] Q on Array of Objects Re:(6)
> Date: Tuesday, 30 November 1999 12:58 PM
>
> Hi Andrew,
>
> Those were the words of [EMAIL PROTECTED]:
> > Andrew wrote:
> > > Words in objects which refer to functions are copied. Therefore
the
> > object will be bigger than expected.
> >
> > Ingo wrote:
> > > Seems logical, given that functions are the same as data in
Rebol,
> > but it would be nice to have them only once for a set of equal
objects,
> > ..
> >
> > Yes. I'm thinking there should be a way of recreating objects so
as to
> > have sort of ability. It would probably mean loosing the ability to
mix
> > code and data. Something like the Interface and Implementation
objects
> > I posted earlier.
>
> That could be a way to make it work now. Another approach could be
> a refinement to set:
>
> set/reference
>
> that always only adds a reference to the real value, you had to
manually
> set all words in the object, you want only once, but it could also be
used
> to add class variables.
>
>
> regards,
>
> Ingo
>
> -- _ . _
> ingo@)|_ /| _| _ <We ARE all ONE www._|_o _ _ ._ _
> www./_|_) |o(_|(/_ We ARE all FREE> ingo@| |(_|o(_)| (_|
> http://www.2b1.de/Rebol/ ._| ._|