<div dir="ltr">Would it work to make it use syntax-local-infer-name but only use the symbolic part of that name?<div><br>Robby</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Dec 9, 2013 at 3:34 PM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@cs.indiana.edu" target="_blank">samth@cs.indiana.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Aha, I found the example:<br>
<br>
(let ([foo ((lambda (#:kk x) (λ (x) x)) #:k 0)]) (foo 5))<br>
<br>
Has this error:<br>
<br>
application: procedure does not expect an argument with given keyword<br>
procedure: foo<br>
given keyword: #:k<br>
arguments...:<br>
#:k 0<br>
<br>
<br>
Note that if you make the keywords the same, `foo` is indeed bound to<br>
a procedure, but _not_ to the procedure referred to in the error<br>
message.<br>
<br>
Sam<br>
<br>
On Mon, Dec 9, 2013 at 4:29 PM, Sam Tobin-Hochstadt<br>
<div class="HOEnZb"><div class="h5"><<a href="mailto:samth@cs.indiana.edu">samth@cs.indiana.edu</a>> wrote:<br>
> I haven't found a way to make it happen yet. But even so, it seems<br>
> like the wrong name.<br>
><br>
> Sam<br>
><br>
> On Mon, Dec 9, 2013 at 4:16 PM, Robby Findler<br>
> <<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>> wrote:<br>
>> Is it possible that that name can leak out in an error message?<br>
>><br>
>> Robby<br>
>><br>
>><br>
>><br>
>> On Mon, Dec 9, 2013 at 3:10 PM, Sam Tobin-Hochstadt <<a href="mailto:samth@cs.indiana.edu">samth@cs.indiana.edu</a>><br>
>> wrote:<br>
>>><br>
>>> Currently, this program fails with a somewhat bizarre type error:<br>
>>><br>
>>> #lang typed/racket<br>
>>><br>
>>> (: foo ([#:k Any] -> Integer))<br>
>>> (define (foo #:k [s #f]) 0)<br>
>>><br>
>>> (let: ([i : Integer (foo #:k #t)]) i)<br>
>>><br>
>>> The reason is that the expansion of keyword applications generates a<br>
>>> name to use for the function (here `foo`), and it uses<br>
>>> `syntax-local-infer-name` to get the name to use. Unfortunately, in<br>
>>> this case, it produces `i`, an identifier which has an extra syntax<br>
>>> property saying that `i` is an `Integer`. Of course, `foo` isn't an<br>
>>> integer, it's a function, and so we get a type error.<br>
>>><br>
>>> I don't see why the inferred name is the right choice here -- there's<br>
>>> no connection between `i` and the name of the function. I can just<br>
>>> change this to use a fresh name, but I thought I'd ask first.<br>
>>><br>
>>> Sam<br>
>>> _________________________<br>
>>> Racket Developers list:<br>
>>> <a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
>><br>
>><br>
</div></div></blockquote></div><br></div>