[REBOL] Re: Rebol interpreter bug with comparison of dates
From: jan:skibinski:sympatico:ca at: 3-Dec-2002 23:44
Hi Andrew,
> I prefer being able to compare any-value with any-value. I think it's more
> versatile, as it enables one to write 'find -like functions that can find
> values in a series and not have to type check first. Here's an example that
> I was working on today (and where I found the problem):
One of us is really confused here. :-)
I am provoked to use the type annotations here,
but believe me - that was not my intention to start with. :-)
You wrote a generic function
find-range :: [[b]] -> b -> [[b]]
which accepts a block of blocks of entities 'b and an entity 'b
as its two arguments, which you call 'Ranges and 'Value.
Your function produces as a result a block of blocks of the same entity 'b.
And you do not compare apples to oranges inside your function!
You correctly compare entities of the same type. But you wrote
the GENERIC function, which can work on any GENERIC
variable 'b, such as DATE, or an INTEGER, etc. For example::
>> find-range [[1 3][31 35] [38 91]] 32
== [[31 35] [38 91]]
So why do you need comparing apples to oranges, may I ask?
Best wishes,
Jan
P.S. Thanks for the advice about redundant parenthesis