[racket-dev] Search by example (was Re: Roogle?)

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Aug 6 16:41:25 EDT 2011

There isn't a way to do that, no.

But I think in Racket we have better ways of avoiding such danger
(namely using the sandbox library or the pieces it builds upon). In
general, in fact, you'd have to do that anyways, since a contract can
be some arbitrary predicate (and don't forget do-dads like #:pre and


On Sat, Aug 6, 2011 at 3:31 PM, Tony Garnock-Jones <tonyg at ccs.neu.edu> wrote:
> [Oops - forgot to reply to all.]
> To build a sketch of this, I've found module->exports, dynamic-require
> and friends, but I think I'd need procedures along the lines of
>   function-contract? : any -> boolean
>   function-contract-domain-contracts : function-contract? ->
>     (listof contract?)
>   function-contract-range-contracts : function-contract? ->
>     (listof contract?)
> I see contract?, flat-contract? etc, but I don't see anything that could
> let me take apart a contract to use its pieces. Is there any such thing?
> (Also there are, as usual, interesting wrinkles with search-by-example
> with higher-order functions.)
> Regards,
>  Tony
> On 2011-08-06 3:13 PM, Tony Garnock-Jones wrote:
>> Not with search by type, but at the risk of derailing the thread, I have
>> had quite a few positive experiences with search by example.

Posted on the dev mailing list.