[racket-dev] define-struct exports something to BSL

From: Nadeem Abdul Hamid (nadeem at acm.org)
Date: Tue Sep 21 19:08:21 EDT 2010

Consider a beginner file with:
   (define-struct boa (name length))

Student writes a template/function with parameter named "a-boa", but
misspells one occurrence, writing "boa" instead of "a-boa".

(define (feed a-boa)
  (make-boa (boa-name a-boa)
            (boa-length boa)))

Their tests then fail at runtime with:
   boa-length: expects argument of type <struct:boa>; given (make-signature ...)

Why is "boa" as a type visible at all in the student languages? The
make-signature thing is really confusing, because they recognize it as
something like a constructor but they don't know what structure it
corresponds to.

--- nadeem

Posted on the dev mailing list.