[racket] Contract weirdness: "broke contract [...]; expected <part?>, given: #<part>"

From: Carlos Scheidegger (carlos.scheidegger at gmail.com)
Date: Sat Nov 6 14:37:34 EDT 2010

For whatever's worth, here's a simple reproduction case with 2 files
of ~25 lines each


To reproduce:

untar that file anywhere, then

$ cd repro; racket

Welcome to Racket v5.0.1.
> (require "posts.rkt")
> (define posts (load-posts "posts"))
> (part->xexpr (first posts))
  (div ((class "part-title")) (h1 "This is a new title"))
  (p "There would be some blocks here"))

(This worked. However,)

$ cd repro; racket serve.rkt

should fail with the contract exception.

Thanks again,

On Sat, Nov 6, 2010 at 2:06 PM, Carlos Scheidegger
<carlos.scheidegger at gmail.com> wrote:
> Hi,
> This must be a simple question, but I'm having some trouble convincing
> Racket that one of my procedure calls respects the required contract,
> and I'm not quite sure how to solve it.

Posted on the users mailing list.