Thanks Robby for your answer,<br><br>When I create an annotated-proc (as in <a href="http://docs.racket-lang.org/reference/procedures.html">http://docs.racket-lang.org/reference/procedures.html</a>)<br><br>Unfortunately it seems that I lose type information:<br>
<br>> (annotated-proc (lambda (x) x) (gensym))<br><br>- : annotated-proc<br>#<procedure><br>> (lambda (x) x)<br><br>- : (Any -> Any : ((! False @ 0) | (False @ 0)) (0))<br>#<procedure><br>> <br><br>
So it seems in Typed Racket applicable structs cannot replace closures?<br><br><br><div class="gmail_quote">2011/11/24 Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Not a direct answer to your question, but comparing procedures for<br>
equality using eq? can be fragile (contracts will break the equality,<br>
depending on how you use them, for example).<br>
<br>
You might instead use applicable structs to implement the equality by<br>
putting some token you use for equality into a second field.<br>
<br>
Robby<br>
<div><div></div><div class="h5"><br>
On Thu, Nov 24, 2011 at 2:14 PM, Ismael Figueroa Palet<br>
<<a href="mailto:ifigueroap@gmail.com">ifigueroap@gmail.com</a>> wrote:<br>
> I need to compare to procedures for equality. In the untyped version of the<br>
> code I used eq? and it worked for my purposes.<br>
> Now, in the Typed Racket version I'm having the problem that somehow one of<br>
> the procedures is wrapped in a "typed value" struct while the other is not.<br>
><br>
> When I display the values I get:<br>
><br>
> #<Typed Value: #<procedure:A>> #<procedure:A><br>
><br>
> is there any way to unwrap the value?<br>
><br>
> Thanks<br>
> --<br>
> Ismael<br>
><br>
><br>
</div></div>> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br>Ismael<br><br>