[REBOL] Re: Rebol interpreter bug with comparison of dates
From: carl:cybercraft at: 4-Dec-2002 21:08
On 04-Dec-02, Anton wrote:
> Andrew,
> An invalid comparison should throw an
> "invalid comparison" error.
> If a < b returns false, that implies
>> = b should return true, but
> under your scheme it would also return false.
> I think your scheme would produce far more
> complications.
I tend to agree here - it should return an error when it doesn't make
sense to compare different datatypes.
> Maybe an explanation for the problem is that
> the < operator tries to convert the second
> argument to the datatype of the first argument.
> So a word can perhaps be converted to a date
> (I did this in the console via a string).
> But I had trouble converting a word to a date!
> Anton.
>> Carl wrote:
>>> Andrew wrote:
>>>> The correct response from Rebol should be like:
>>>>>> 4/Dec/2002 < 'foo
>>>> == false
>> Don't you mean true? Surely they both can't be greater than each
>> other?
>>
>> I'm right. :) Both:
>> 4/Dec/2002 < 'foo
>> and:
>> 'foo < 4/Dec/2002
>> should return 'false, because both are invalid comparisons.
>>
>> Andrew Martin
--
Carl Read