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

[REBOL] Re: Rebol interpreter bug with comparison of dates

From: carl:cybercraft at: 4-Dec-2002 15:23

On 04-Dec-02, Jan Skibinski wrote:
> Hi Andrew, > The problem seems to be much broader: >>> 2 < 'foo > ** Script Error: Expected one of: integer! - not: word! > But at least in this case the error message makes some sense. > Personally, I don't mind such a behaviour, which disallows > comparison of apples to oranges. But I think the definition > of (<) is too broad: it should be more specific - narrowed > down to the orderable things, such as numbers, dates, > but not points, etc. However, since the arguments of this > operator are untyped, the "help <" suggests that one can > compare anything to anything - and hence those unpleasent > runtime surprises. > Jan
Going by previous comments, I think the comparing of different types is allowed so routines for soting them will work. ie...
>> sort [2 foo]
== [foo 2]
>> sort [foo 2]
== [foo 2] -- Carl Read