[racket] TR: unwrapping from <#Typed Value: ... > ??

From: Ismael Figueroa Palet (ifigueroap at gmail.com)
Date: Thu Nov 24 16:46:06 EST 2011

Thanks Robby for your answer,

When I create an annotated-proc (as in
http://docs.racket-lang.org/reference/procedures.html)

Unfortunately it seems that I lose type information:

> (annotated-proc (lambda (x) x) (gensym))

- : annotated-proc
#<procedure>
> (lambda (x) x)

- : (Any -> Any : ((! False @ 0) | (False @ 0)) (0))
#<procedure>
>

So it seems in Typed Racket applicable structs cannot replace closures?


2011/11/24 Robby Findler <robby at eecs.northwestern.edu>

> Not a direct answer to your question, but comparing procedures for
> equality using eq? can be fragile (contracts will break the equality,
> depending on how you use them, for example).
>
> You might instead use applicable structs to implement the equality by
> putting some token you use for equality into a second field.
>
> Robby
>
> On Thu, Nov 24, 2011 at 2:14 PM, Ismael Figueroa Palet
> <ifigueroap at gmail.com> wrote:
> > I need to compare to procedures for equality. In the untyped version of
> the
> > code I used eq? and it worked for my purposes.
> > Now, in the Typed Racket version I'm having the problem that somehow one
> of
> > the procedures is wrapped in a "typed value" struct while the other is
> not.
> >
> > When I display the values I get:
> >
> > #<Typed Value: #<procedure:A>> #<procedure:A>
> >
> > is there any way to unwrap the value?
> >
> > Thanks
> > --
> > Ismael
> >
> >
> > _________________________________________________
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
> >
>



-- 
Ismael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111124/6e591fd6/attachment.html>

Posted on the users mailing list.