[REBOL] Re: RFC on support for user-defined "types"
From: ingo:2b1 at: 11-Jun-2002 19:40
Joel Neely wrote:
> 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).
> Feedback, comments, etc. welcome as always!
That sounds very rebolious to me ... and a valuable addition, too!
As much as I'd like "a facility that would allow me to define lexical
syntax for a new data type, along with appropriate input/output
formatting rules" (to quote from your other post), I don't believe that
we'll see it (at least not before 4.0), but these object! tests seem to
be doable (INARTE and all, af course).