[REBOL] Re: The Rebol type system
From: joel:neely:fedex at: 7-Nov-2001 8:57
Maarten Koopmans wrote:
> Hi Joel,
> datatype! types (so I can make op2! types).
> op! types
Yes, I'd sure like to have a MAKE OP! option. One might imagine
that it would require a two-argument function (which could be
checked at definition time) and create a new binary operator
hypotenuse: make op! function [x [number!] y [number!]] [
square-root x * x + (y * y)
would allow one subsequently to write
z: 3 hypotenuse 4
I have no idea how hard this would be for RT, but it appears that
the lexical part of the work is already done...
>> alias '* "times"
>> 3 times 4
> the next 500 types I can find a use for.
> Yes there are languages that allow you this that I use sometimes:
> - Haskell
> - Objective Caml (a ML dialect)
Right! I was expecting to see some thing in the Haskell/ML arena.
(Hardly garden-variety, J. Random Programmer languages, though!)
I wonder if there are enough bits in the type field to support very
many additions... (ONLY KIDDING! ;-)
This sentence contradicts itself -- no actually it doesn't.
-- Doug Hofstadter