Inequality testing Shiro Kawai (21 Jan 2026 09:05 UTC)
Re: Inequality testing jobol (21 Jan 2026 09:30 UTC)

Re: Inequality testing jobol 21 Jan 2026 09:30 UTC

Le Tue, 20 Jan 2026 23:05:29 -1000,
Shiro Kawai <xxxxxx@gmail.com> a écrit :

> N-ary nature of Scheme comparison operators allows us to write
> relation tests like 0 < x < 100 as (< 0 x 100).  However, equally
> frequent tests like 0 <= x < 100 can't be written concisely.  The
> asymmetry is mildly frustrating.
>
> Recently Gauche adopted a macro ineq.  (ineq 0 <= x < 100) expands
> into:
>
> (let ((tmp x))
>   (and (<= 0 tmp) (< tmp 100)))
>
> If we allow (expr 0 < x < 100) but not (expr 0 <= x < 100), it feels
> like an artificial constraint from users' perspective, even though it
> makes expansion a lot more complicated.  Is it worth considering?

Hello, yes it is worth! It has to be in the final spec.

regards - josé