|
problem with is
Jakub T. Jankiewicz
(03 Apr 2026 09:56 UTC)
|
|
Re: problem with is
Maciek Godek
(03 Apr 2026 11:23 UTC)
|
|
Re: problem with is
Jakub T. Jankiewicz
(03 Apr 2026 13:13 UTC)
|
|
Re: problem with is
Andrew Tropin
(03 Apr 2026 14:53 UTC)
|
|
Re: problem with is Andrew Tropin (03 Apr 2026 14:51 UTC)
|
|
Re: problem with is
Andrew Tropin
(03 Apr 2026 14:40 UTC)
|
|
Re: problem with is
Jakub T. Jankiewicz
(03 Apr 2026 18:20 UTC)
|
|
Re: problem with is
John Cowan
(03 Apr 2026 23:29 UTC)
|
|
Re: problem with is
Andrew Tropin
(04 Apr 2026 04:41 UTC)
|
|
Re: problem with is
Andrew Tropin
(04 Apr 2026 04:12 UTC)
|
On 2026-04-03 13:23, Maciek Godek wrote: > FWIW "is" is also used by SRFI-156 for an entirely different purpose Hi Maciek! should be not a big deal, as we can export with rename/prefix. (t:test "our test" (t:is (is 2 = 2))) or (test "our test" (is (infix 2 = 2))) > > pt., 3 kwi 2026 o 11:57 Jakub T. Jankiewicz <xxxxxx@jcubic.pl> napisaĆ(a): > >> 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 >> -- Best regards, Andrew Tropin