gmauer
2021-10-26 12:34:56

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:


badkins
2021-10-26 23:56:07

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?


badkins
2021-10-26 23:58:42

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.


badkins
2021-10-27 00:00:17

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)


badkins
2021-10-27 00:00:52

It seems raco test is explicitly checking for this sort of discrepancy i.e. mismatch in number of args between function and contract.


samdphillips
2021-10-27 00:32:38

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]


samdphillips
2021-10-27 00:33:22

contract attachment happens at runtime that’s why raco make doesn’t see it.