> On Jul 16, 2016, at 3:20 AM, mattapiro...@gmail.com wrote: > > Hi, > > Thanks again and again for all the work on racket. Great language / > implementation. > > I wonder if there's a way to get the contract of functions in the libraries?
Well, it depends. If a value is guarded with certain types of chaperone or impersonator contracts, you can use the `value-contract` function to get a contract http://docs.racket-lang.org/reference/contract-utilities.html#%28def._%28%28lib._racket%2Fcontract%2Fprivate%2Fguts..rkt%29._value-contract%29%29 That's what the `contract-repl` package does: https://github.com/takikawa/contract-repl/tree/master > (define/contract (f x) (-> exact-integer? exact-integer?) x) > f - : (-> exact-integer? exact-integer?) #<procedure:f> > (value-contract f) (-> exact-integer? exact-integer?) > PS. I'm trying to find target functions in the namespace that'll 'match' the > values I have (i.e. that can 'work with' the values I have). Any guidance on > an easier or different approach are greatly welcome. However, you'll notice a lot of library function (that are documented with contracts) aren't actually guarded with a contract in this way. They do the checking themselves instead, which means `value-contract` and `contract-repl` won't work for them. I have no idea how you could get the documented contract from the docs. > PPS. I use untyped :) Ok. Wait, even if you're using untyped racket, you might still be able to use the typed-racket types in some way. I don't know how you would want to use them though. Alex Knauth -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.