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

[REBOL] About object!s and custom datatypes

From: hallvard::ystad::oops-as::no at: 2-Jan-2005 21:15

Hello Gabriele et al., I tried to use custom-types.r to make my own datatype, but it didn't work, because some of Ladislavs subfunc-stuff crashed somehow. But here's a more theoretical question: I was considering turning my url-object (http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?color=yes&script=url-handler.r) into a datatype for the RIX. I thought that would make way for clearer code. Some of the comparisons I do with URLs take place in a method inside the object. Instead of site1/equal? site2 I would like to write equal? site1 site2 like with basic datatypes like string!s and integer!s. The question is: Would this slow rebol down? What are the most important advantages and disadvantages of making one's own datatypes? I can think of this, for a start: I have, in the 'equal? func, refinements like /regard-section and /regard-cgi-order. I guess these cannot be brought into the 'equal? action? Or is this not so? I find the idea of custom datatypes interesting. Please enlighten me on it's (dis)advantages. Regards, HY