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

[REBOL] Re: percent! - new datatype request

From: robbo1mark:aol at: 10-Jun-2002 12:49

To implement a percent! datatype or any other "shopping list" of new datatypes requires one to write an extended version of the LOAD function to parse script input and correctly identify and make new object! instances of the percent! and other new datatypes. You also have to extend the TYPE? function to correctly handle your special new object! datatype representations and return your intended percent! or whatever. Any other new methods such as arithmetic, print / output formatting etc also have to be defined. Basically your write another interpreter and functions on top of REBOL to handle your new datatypes, which is certainly do-able and REBOL/Core has loads of useful functions for implementing this. A reader macro function like the lisp / scheme 'extend-syntax and 'syntax-rules functions for REBOL would make this so much easier and allow for easier extensions of REBOL at the mezzanine level as Joel would like. Maybe it would be better if REBOL like Lisp, Scheme, Perl, PHP, Python, Ruby, TCL, OCAML, to name but a few, could be extended at ALL levels and not just the mezzanine level but we've done this to death before - sigh! Mark Dickson