[racket-dev] Search by example (was Re: Roogle?)
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
friends).
Robby
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.
>