problem with is Jakub T. Jankiewicz (03 Apr 2026 09:56 UTC)
Re: problem with is Maciek Godek (03 Apr 2026 11:23 UTC)

problem with is Jakub T. Jankiewicz 03 Apr 2026 09:56 UTC

The name `is`, in its current form, is problematic. It doesn't make sense
semantically. `is` should compare two values not compare if something is
truthy.

In normal sentence you have:

x is y

so the prefix notation should be:

(is x y)

And the best way to implement `is` is using equal.

(define (is x y)
  (if (not (equal x y))
      (signal "Error")))

in LISP Scheme, I use JavaScript testing framework called AVA. The tests
looks like this:

(test "core: values without wrapping"
      (lambda (t)
        (t.is (values 1) 1)
        (t.is #void (values))))

t is an object from AVA that have is method. But I use `t.is` macro anyway.
LIPS Scheme use JavaScript dot notation.

And if `is` must be an assert, like the doc string in example implementation
says. Then it should be called accordingly.

(assert (= 1 2))

I'm not sure what `assert` in the example implementation is (it's used by
`is` macro). `assert` is not part of the R7RS.

And if guile-ares-rs wants to use `(is x)` this can be easily abstracted with
a macro.

(define-library (ares-test)
  (export (rename assert is))
  (import (scheme base)
          (test))

  (define-syntax assert
    (syntax-rules ()
      ((_ expr)
       (is expr #t)))))

Jakub

--
Jakub T. Jankiewicz, Senior Front-End Developer
https://jakub.jankiewicz.org
https://lips.js.org
https://snapp.md
https://koduj.org