Hi Ludovic,
[email protected] (Ludovic Courtès) writes:
> Mark H Weaver <[email protected]> skribis:
>> + (pass-if "set-fields with one path as a prefix of another"
>> + (let ()
>> + (define-immutable-record-type foo (make-foo x) foo?
>> + (x foo-x)
>> + (y foo-y set-foo-y)
>> + (z foo-z set-foo-z))
>> +
>> + (define-immutable-record-type :bar (make-bar i j) bar?
>> + (i bar-i)
>> + (j bar-j set-bar-j))
>> +
>> + (catch 'syntax-error
>> + (lambda ()
>> + (compile '(let ((s (make-bar (make-foo 5) 2)))
>> + (set-fields s
>> + ((bar-i foo-x) 1)
>> + ((bar-i foo-z) 2)
>> + ((bar-i) 3)))
>> + #:env (current-module))
>> + #f)
>> + (lambda (key whom what src form subform)
>> + (equal? (list key whom what form subform)
>> + '(syntax-error set-fields
>> + "one field path is a prefix of another"
>> + (set-fields s
>> + ((bar-i foo-x) 1)
>> + ((bar-i foo-z) 2)
>> + ((bar-i) 3))
>> + (bar-i)))))))))
>
> You might want to use ‘pass-if-equal’ here, for better reporting.
I see now what you meant, and I just pushed a patch to convert these to
use 'pass-if-equal'.
I also pushed a couple more patches to improve error reporting.
Thanks!
Mark