[plt-scheme] Better error msg for contract?
Yeah, that's a bug. Its fixed in SVN, now. Here's the current message
for that program:
/Users/robby/tmp.ss:3:15: struct/c: expected 2 contracts because
struct xpto has 2 fields in: (do-struct/c xpto integer?)
Thanks.
Robby
On 3/9/07, Paulo J. Matos <pocm at soton.ac.uk> wrote:
> 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.
>
> Cheers,
> --
> Paulo Jorge Matos - pocm at soton.ac.uk
> http://www.personal.soton.ac.uk/pocm
> PhD Student @ ECS
> University of Southampton, UK
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>