> On Jul 11, 2019, at 12:34 PM, Alex Knauth <alexan...@knauth.org> wrote:
> 
> 
> 
>> On Jul 11, 2019, at 1:15 PM, Kevin Forchione <lyss...@gmail.com 
>> <mailto:lyss...@gmail.com>> wrote:
>> 
>>> On Jul 10, 2019, at 9:14 PM, Matthias Felleisen <matth...@felleisen.org 
>>> <mailto:matth...@felleisen.org>> wrote:
>>> 
>>> [(contract (-> string? integer?) (λ (x) x) 'a 'b)
>>> "hello”]
>> 
>> By the way, I’ve been playing around with this (and define/contract) and it 
>> seems that ‘a in the above refers to the function itself, while to the best 
>> of my knowledge ‘b refers to … the module pathname? Is that how this is 
>> supposed to report?  So in a macro I’d use something like (syntax-source 
>> #’#f) to retrieve that. But I’m suspicious that that is too simplistic. 
> 
> That `b` position, represents the negative blame position, which should be 
> the current contract region, which is often the current module. However, the 
> forms from `racket/contract/region` (including define/contract) can change 
> this using current-contract-region.
> 
> If you want to have that `b` be inferred as the current contract region for 
> you, you can use
> 
> (with-contract a #:result (-> string? integer?) (λ (x) x))
> 
> instead of (contract (-> string? integer?) (λ (x) x) 'a 
> (current-contract-region)).

Thanks, Alex! 

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/CF0C0FDF-6418-4926-8B01-5ED04B65AD5D%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to