What you are missing is that I want the function element of door-man (speak)
to call a global function defined outside of the object to perform the
functionality. Otherwise, how the object gets defined (either through make
object! or a template object) doesn't really matter.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 26, 2000 5:14 PM
To: [EMAIL PROTECTED]
Subject: [REBOL] refinements Re:(5)
Michael Jelinek wrote:
> door-man: make object! [
> vocab1: "hello"
> vocab2: "world"
> speak: func [][say-greeting self]
> ]
>
> say-greeting: func [idiot][
> print [idiot/vocab1 idiot/vocab2]
> ]
>
> door-man/speak
May be I'm missing something crucial, but wouldn't this be simpler:
Person: [
vocab1: string!
vocab2: string!
speak: func [] [
print [vocab1 vocab2]
]
]
Extend: func [Base [block!] Extension [block!]] [
append copy/deep Base Extension
]
door-man: make object! Extend Person [
vocab1: "hello"
vocab2: "world"
]
door-man/speak
I'm sure that I must be missing something important. Can you let me know
what it is, please?
Andrew Martin
Black boxer...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-