[(contract (-> string? integer?) (λ (x) x) 'a 'b)
 "hello”]




> On Jul 10, 2019, at 10:11 PM, Kevin Forchione <lyss...@gmail.com> wrote:
> 
> Hi guys,
> Is there a way to apply contracts to a lambda without associating it with an 
> identifier? What I want is to be able to pass lambda functions around without 
> having to bind them to a symbol. I could use raise-argument-error/ 
> raise-result-error but the contract system is more powerful and  I’m hoping 
> there’s a wrapperI of some sort that will do the trick. Something like:
> 
> (assert-contract [tag] (lambda argspec contract-spec body …)) ;; <= [ta] 
> would just be a symbol for the error message 
> 
> Kevin
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/B0725B4A-8D61-4F6C-AE31-9A7E067F82AE%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/90A0CD6C-1349-4BB7-B51A-9D83E6271CE9%40felleisen.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to