<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Would there be a way to test the type for making decisions at run-time (not just with predicates)?</div><div><br></div><div>For example:</div><div><font face="Courier New">(cond [(:has-type? f (Number -> Any))</font></div><div><font face="Courier New"> (f 1)]</font></div><div><font face="Courier New"> [(:has-type? f (String -> Any))</font></div><div><font face="Courier New"> (f "1")])</font></div><br><div><div>On Jun 16, 2014, at 6:54 AM, Matthias Felleisen <<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>That's what I thought you wanted it for so my answer stands -- Matthias</div><div><br></div><div><br></div><br><div><div>On Jun 15, 2014, at 12:55 AM, Spencer Florence wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">This is about making decisions at compile time. Specifically I have a sequence of expressions I want to partition into expressions of some type T and expressions of other types.<br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sat, Jun 14, 2014 at 7:34 PM, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu" target="_blank">robby@eecs.northwestern.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Would it be enough to expand into an 'ann' expression? Or do you need<br>
to make decisions at compile time based on whether or not the types<br>
worked?<br>
<span class="HOEnZb"><font color="#888888"><br>
Robby<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sat, Jun 14, 2014 at 2:04 PM, Matthias Felleisen<br>
<<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>> wrote:<br>
><br>
> No, TR expands first, then checks. -- Matthias<br>
><br>
><br>
><br>
><br>
> On Jun 14, 2014, at 2:59 PM, Spencer Florence wrote:<br>
><br>
>> Hey All,<br>
>><br>
>> I'm trying to take advantage of typed/racket in a few macros. Is there any way to check the type of an expression from its syntax object? something like:<br>
>><br>
>> (:has-type? (-> Void) #'expression)<br>
>><br>
>><br>
>> --Spencer<br>
>> ____________________<br>
>> Racket Users list:<br>
>> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
><br>
> ____________________<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>
</blockquote></div><br>
</div>____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>