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

The Rebol type system

 [1/6] from: ammonjohnson::yahoo::com at: 7-Nov-2001 15:10


<snip...>
> I'd love to be able to create my own values of type OP! (then we'd > *really* have a dialecting language ;-), but are there others that > you'd like to be able to instantiate?
I would love to be able to create a Native! Just think, if you could create a Native! you could create a self extracting/unencoding script that, because the user can't see what is in the text (it being a bunch of jiberish), & PROBEing, or SOURCEing the function returns Native! no one can steal your code. ;-) My 2 Ammon

 [2/6] from: koopmans:itr:ing:nl at: 7-Nov-2001 13:08


Hi, What *is* the Rebol type system? Why can't I make new types? Why can't I instantiate some types? Why.....? --Maarten

 [3/6] from: joel:neely:fedex at: 7-Nov-2001 0:43


Hi, Maarten, Maarten Koopmans wrote:
> Hi, > > What *is* the Rebol type system? >
One of the profound mysteries of the universe, ranking just after quantum gravitation and hanging chads.
> Why can't I make new types? >
Because your name isn't Carl. And you also can't tear that little tag off of your sofa cushions!
> Why can't I instantiate some types? >
See previous answer.
> Why.....? >
Because. (Sorry, I couldn't help myself... ;-) Seriously, I could offer the standard platitudes about a datatype being a class of values and the set of operations that can be applied to them, but I suspect that any real answer would have to come from comments by RT staff (anybody listening, hint hint...) or with the publication of documentation of "inner REBOL" (for which I'm devoutly wishing but not holding my breath). Out of curiousity, are you currently using any language that *does* allow you to create your own types? I'd love to be able to create my own values of type OP! (then we'd *really* have a dialecting language ;-), but are there others that you'd like to be able to instantiate? -jn- -- Unix is user-friendly, its just picky about who it's friends with. -- Douglas O'Neal joel[dot[FIX[PUNCTUATION[neely[at[fedex[dot[com

 [4/6] from: media:quazart at: 7-Nov-2001 7:58


aren't the types internal to rebol? you would have to get access to the REBOL dialect parser itself in order to handle new types of data arrangement transparently. Unless someone else has some enlightening information, That's what I understand of the datatype system... I do wish it was possible to supply a user hook when Rebol handles code, so that we could do such things as add new datatypes at run-time... -MAx

 [5/6] from: koopmans:itr:ing:nl at: 7-Nov-2001 14:01


Hi Joel, datatype! types (so I can make op2! types). op! types 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) --Maarten On Wednesday 07 November 2001 07:43, you wrote:

 [6/6] from: joel:neely:fedex at: 7-Nov-2001 8:57


Hi, Maarten, 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 so that 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"
== times
>> 3 times 4
== 12
> 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! ;-) -jn- -- This sentence contradicts itself -- no actually it doesn't. -- Doug Hofstadter joel<dot>neely<at>fedex<dot>com