<div dir="ltr">Or maybe the expansion could be tweaked? (and a test case added?)<div><br></div><div>Robby</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 25, 2013 at 10:50 AM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu" target="_blank">samth@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Jun 24, 2013 at 8:21 AM, Matthias Felleisen<br>
<<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>
><br>
> On Jun 23, 2013, at 8:34 PM, Sam Tobin-Hochstadt wrote:<br>
><br>
>>><br>
>>> After porting nearly everything I was left with typing up the command-line<br>
>>> parser. However, I am getting a type error at the following simplified part:<br>
>><br>
>> Here's a version that type checks: <a href="https://gist.github.com/samth/5847063" target="_blank">https://gist.github.com/samth/5847063</a><br>
>><br>
>> The key is giving a type annotation to `fname` using the #{} syntax.<br>
>> Typed Racket can figure out how to typecheck the expansion only if you<br>
>> give it that hint. And the #{} syntax is for adding such hints with<br>
>> macros like `command-line` that didn't anticipate Typed Racket.<br>
><br>
><br>
> I think this answer is not fair.<br>
><br>
> Because<br>
><br>
> On Jun 23, 2013, at 2:21 PM, Tim K. wrote:<br>
><br>
>> I wonder, why does fname have the "Any" type? Yes, I didn't explicitly give<br>
>> fname a type, but I was hoping that the typed version of "command-line"<br>
>> would do that<br>
><br>
> is correct. command-line in a typed context should know that what flows into<br>
> its world is a string.<br>
<br>
</div></div>This could mean one of two things. One is that `command-line` could<br>
be treated specially in Typed Racket (or there's a<br>
`typed/racket/command-line` library), so that it's like those<br>
identifiers were already given the type `String`. This would be<br>
technically challenging (without requiring the extra library), and is,<br>
I think, a bad idea. The other is that Typed Racket could improve its<br>
inference, so that it can just tell that only `String` is possible<br>
there. This is my preferred solution, but it will require some<br>
significant work on improving inference in Typed Racket that I don't<br>
think will happen in the very near future.<br>
<span class="HOEnZb"><font color="#888888"><br>
Sam<br>
</font></span><div class="HOEnZb"><div class="h5">____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</div></div></blockquote></div><br></div>