yeah, renders to HTML isn’t bad, but github no longer renders README.html so you have to go through a whole site publication process, can’t just throw it up at a github repo and shrug :confused:
When I run raco test foo.rkt
and get a “foo: broke its own contract” error - how is that being produced when the function is not invoked?
Alternatively, is there a flag I can pass to raco make
to produce this error since it seems possible to produce it at compile time.
Sorry, here’s the full error for context: get-user-data: broke its own contract
promised: a procedure that accepts 3 non-keyword arguments
produced: #<procedure:get-user-data>
get-user-data accepts: 4 arguments
in: (-> connection? string? string? any)
It seems raco test
is explicitly checking for this sort of discrepancy i.e. mismatch in number of args between function and contract.
IIRC when you attach a function contract to a value it does an arity check. > (define/contract (f x) (-> any/c any/c any) x)
; f: broke its own contract
; promised: a procedure that accepts 2 non-keyword arguments
; produced: #<procedure:f>
; f accepts: 1 argument
; in: (-> any/c any/c any)
; contract from: (function f)
; blaming: (function f)
; (assuming the contract is correct)
; at: readline-input:2:18
; [,bt for context]
contract attachment happens at runtime that’s why raco make doesn’t see it.