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

[REBOL] Re: Tuples - Was Pair! thread

From: joel:neely:fedex at: 6-Feb-2002 14:46

Here's one example, Mark: [Robbo1Mark--aol--com] wrote:
> Holger / Joel / Everybody > > being following this thread with interest, > is there any reason then why comparators should > work with tuples? > > >> 1.1.2 > 1.2.1 > == false > > seems reasonable to me... >
Aside from the generic argument that all built-in types should (IMHO) be allowed to participate in the widest possible range of primitive operations, consider the fact that tuples can be used to represent a wide range of concepts based on a small ordered sequence of small integers: section numbers (e.g., in a document) and IP addresses are the first two that come to mind. Simple lexical/dictionary order (compare first, second, etc. parts until order is established or equality is demonstrated by hitting the end of both simultaneously) serves nicely as an ordering for both of those. E.g., determining whether the IP address of a box lies within some assigned range of addresses requires that tested address be at least the low end of the range and at most the high end of the range. The fact that I can also use tuples to represent other concepts with quite different semantics doesn't change this fact; it simply means that I would need to raise my level of thinking above the "raw" data type level if I'm using tuples to represent one of those concepts. For example, tuples can also be used to represent colors -- for which there are a variety of useful orderings: lighter-than? darker-than? more-saturated-than? and so forth. But if that's what I'm doing with tuples, then I need to be thinking at that level and implementing those tests appropriately (or using code kindly provided by someone else who figured out how to do so and saved me the trouble).
> ... either that or insufficient thought goes into REBOL > language design & implementation ... >
NO! I think it is quite possible for persons of good will to have different views/priorities and to discuss those differences (even quite enthusiastically! ;-) without resorting to real or implied accusations of unprofessionalism. I freely admit to leaning strongly in the purist/perfectionist direction. However, I've done enough production software development to understand completely that highly competent developers who have specific practical goals, schedules, and various other considerations, may very well come to different conclusions than I might, and for totally wholesome reasons. My questions about ordering of pairs were stimulated by a confusing error message (which Holger quite readily agreed was not the best possible phrasing), but I continued the exchanges in the hopes of providing rationale for RT to reconsider the present state of the language WHEN THEY HAVE TIME TO DO SO, IF THEY EVER DO. And if they never do so, or (as has happened before on this list) RT considers a discussion and declines to accept an offered suggestion, that's OK too! Persons of good will can disagree and still continue to work together. I might also point out that -- over the years -- RT has been VERY GOOD about accepting discussion and suggestions from the folks on this list and acting on many of those to the mutual benefit (I hope) of REBOL, RT, and the REBOL community. I appreciate the attitude and track record of RT in this regard very much. I would like to think that we (list members) can use this list as a forum for discussions with each other and RT to try to understand (and occasionally make suggestions with the goal of improvement) this language that we all enjoy using. However, if my questions/discussion regarding language features are used as the basis for uncharitable accusations about the very folks that support this list and this community, I'll either keep my thoughts to myself or communicate offline with RT. -jn- -- ; sub REBOL {}; sub head ($) {@_[0]} REBOL [] # despam: func [e] [replace replace/all e ":" "." "#" "@"] ; sub despam {my ($e) = @_; $e =~ tr/:#/.@/; return "\n$e"} print head reverse despam "moc:xedef#yleen:leoj" ;