Yes, that's the problem. Also 3d syntax is a potential problem. Perhaps the
new macro expander that Matthew is working on will enable chaperones for
syntax.

Sam

On Tue, Jun 21, 2016, 8:11 AM Robby Findler <ro...@eecs.northwestern.edu>
wrote:

> Is the issue that TR's boundary contract can't tell that there isn't a
> function lurking somewhere in one of the properties of that syntax
> object when it passes across the boundary? (And that function might be
> a function from TR that was compiled with the assumption that it will
> get as inputs only things that are valid according to its type.)
>
> Robby
>
>
> On Mon, Jun 20, 2016 at 11:57 PM, 'John Clements' via Racket Users
> <racket-users@googlegroups.com> wrote:
> > Alas, ensnared again by TR the seductress. Why must you raise my hopes
> only to dash them again?
> >
> > To be more specific: I want to use TR to specify types for some of the
> stepper’s structures. However, structures containing syntax objects are
> giving me fits. Here’s a simple program:
> >
> > #lang racket
> >
> > (module sub typed/racket
> >   (provide (struct-out wrapper))
> >
> >   (struct wrapper ([x : Any])))
> >
> > (require 'sub)
> >
> > (wrapper-x (wrapper #'1234))
> >
> > This type-checks, but fails at runtime with the error:
> >
> > wrapper-x: contract violation
> >   Attempted to use a higher-order value passed as `Any` in untyped code:
> #<syntax:/private/tmp/bar.rkt:10:22 1234>
> >   in: the range of
> >       (-> wrapper? Any)
> >   contract from: (/private/tmp/bar.rkt sub)
> >   blaming: /private/tmp/bar.rkt
> >    (assuming the contract is correct)
> >   at: /private/tmp/bar.rkt:6.10
> >>
> >
> > I’ve tried a bunch of things, including specifying a good type for the x
> field ((Syntaxof Number) works, but in general I want to be able to specify
> any syntax object), and putting the lookup on the TR side (still get the
> same error). I really can’t think of a way of working around this problem.
> >
> > Oh! I just thought of something really evil… create a bogus submodule
> with an OpaqueVal type that wraps anything… nope, sigh, that didn’t work
> either.
> >
> > Any help appreciated!
> >
> > Thanks,
> >
> > John
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to