I'm not sure if this is a bug or if I'm just misunderstanding something.

(define-struct/contract myposn
  ((x number?) (y number?))
  #:transparent)

(make-myposn 3 4) ; works as I would expect

(make-myposn 3 "hello")
complains
#%htdp: '#%htdp broke the contract 
  (-> number? number? symbol? any)
 on make-myposn given to (struct myposn); expected <number?>, given: "hello"

All of this error message makes sense to me except the "symbol?" as the third 
parameter in make-myposn's contract.  One can't actually give a symbol as a 
third argument:
(make-myposn 3 4 'hi)
complains that it was given the wrong number of arguments, as one would expect.


Stephen Bloch
sbl...@adelphi.edu

_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to