lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> > What about my suggestion of an le fallback? (In brief: an le fallback is
> > sufficient for partial ordering; [...]
> Do you mean the following rule?
>   a < b   <==>   a <= b and not b <= a


> I really don't like the idea of calling a method twice for each
> comparison...

The idea is that you only use this rule when there's an le callback but no
lt fallback.

> Or you are proposing to have both a 'le' and a 'lt' fallbacks (in a way
> that you can have only one of them when you don't need the "partial"
> stuff)?

Exactly. You can supply either just lt (if you have a total order), or
just le (for simplicity for a partial order) or both (for efficiency for
a partial order) and it will work in all cases.

Making lt optional does make life simpler for the programmer.

-- | frog, n.  a prince waiting for the right kiss