[plt-scheme] Better error msg for contract?

From: Paulo J. Matos (pocm at soton.ac.uk)
Date: Fri Mar 9 13:38:55 EST 2007

Hello all,

I'm just curious if one can get a better error message for:
(require (lib "contract.ss"))

(define-struct xpto (foo bar))
(define xpto/c (struct/c xpto integer?))

I get:
syntax: incompatible ellipsis match counts for template in: ...

Which is unfortunately not very informative. Quite easy to find out
the missing struct/c argument (contract for one field) in this case
but not so easy in larger program.
I had a lot of code and a struct to which I added a field (among other
code changes). Then I get this error. Problem was I forgot to add the
contract for the structure field (simple!) but in a huge program it
took me 10 min to find the problem.

Paulo Jorge Matos - pocm at soton.ac.uk
PhD Student @ ECS
University of Southampton, UK

Posted on the users mailing list.