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

[REBOL] Re: RFC on support for user-defined "types"

From: greggirwin:mindspring at: 11-Jun-2002 10:53

Hi Joel, << In other words, we'd be specifying (a portion of) the *interface* that an object should possess, rather than a (non-REBOL) notion of "class". This would allow the above hypothetical function definition to be written as: somefunc: func [ a [object! [invert]] b [object! [memorize]] ... ][ ...blah blah blah... ... a/invert ... ... b/memorize ... ] to document/enforce that the first argument must possess an INVERT attribute/method and the second must have a MEMORIZE attribute/method, with the checking to be done by the interpreter at the/each point of function invocation (e.g., as type checking is done now).
>>
What about specifying a prototype object instead of a block of words for an anonymous object? I'm thinking that the list of words could get quite long and perhaps be used in many places which might become burdensome. Just my 2% of $1.00 :) --Gregg