Howdy, Ladislav:

>  If I understood correctly, the work of make "could" (with a big
>  simplification, of course) be described in Rebol like this:
>
>  make-object-sim: func [
>      initializer [block!]
>      /local words
>  ] [
>      words: copy [self]
>      foreach item :initializer [
>          if set-word? :item [
>              append :words to word! :item
>          ]
>      ]
>      words: union :words []
>      use words [
>          bind words 'self
>          self: compose/deep [[(:words)]]
>          do bind/copy initializer 'self
>          :self
>      ]
>  ]

  Hey, that's neato.  I always think describing REBOL in REBOL has a
high coolness factor.  For this rendering, also there are the parent
object's words (or more appropriately called the template object's)
that have to be included in the word block.  Additionally, values from
the template object have to be carried over into the new object.

>  And, my question is as follows: wouldn't it be better (for the
>  sake of preventing some strange effects and to simplify things) to
>  change that to:

>  make-object-sim: func [
 [  . . .   snip ]
>          result: self: compose/deep [[(:words)]]
>          do bind/copy initializer 'self
>          :result
>      ]
>  ]
>
>  ,which is more in a direction of representing any context (with
>  any Self value)

   That could be argued.  (-: The cases where the "strange effects"
show up are pretty oddball cases though.  SELF is supposed to refer to
the self same object. If you decide to make self be something else
besides an object while making an object, then the result probably
shouldn't be an object. It's a little messy there and probably needs
to stay simple. Interesting stuff, though.. :-)

        -jeff

Reply via email to