Re: [racket-dev] TR - no source locations?
On Fri, Nov 26, 2010 at 5:26 AM, Noel Welsh noelwe...@gmail.com wrote: On Tue, Nov 23, 2010 at 6:18 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: What's happening here is that the typed wrapper in `typed/rackunit' is treating `check-equal?' as a function, but it's really an identifier macro that inserts source locations when used in application position. This makes it easy to write a typed wrapper, but it has the drawbacks you see. Probably the solution is to write a better wrapper in `typed/rackunit', but that might be hard without integrating with the internals of Rackunit. How far along is interop for macros in Typed Racket? Would I have to maintain typed and untyped version of Rackunit to do things 'properly'. The right thing to do for `check-equal?' etc is to have versions that take a syntax object to use as the source location, and then TR could use them. I think that in general it's good to provide such versions for macros where the source location is important to support expanding into those macros. -- sam th sa...@ccs.neu.edu _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] TR - no source locations?
I've pushed a fix for the example below, at least. Robby On Tue, Nov 23, 2010 at 12:18 PM, Sam Tobin-Hochstadt sa...@ccs.neu.edu wrote: On Tue, Nov 23, 2010 at 1:04 PM, John Clements cleme...@brinckerhoff.org wrote: On Nov 20, 2010, at 8:19 PM, Sam Tobin-Hochstadt wrote: There are a lot of things you could mean by Typed Racket doesn't preserve source locations. Some of them TR definitely preserves source locations, and some are hard cases where TR tries but doesn't always succeed. So I am also interested in an example. Here's an example: So, here's the same behavior without TR: #lang racket (require rackunit) ((values check-equal?) (odd? 322) #true) What's happening here is that the typed wrapper in `typed/rackunit' is treating `check-equal?' as a function, but it's really an identifier macro that inserts source locations when used in application position. This makes it easy to write a typed wrapper, but it has the drawbacks you see. Probably the solution is to write a better wrapper in `typed/rackunit', but that might be hard without integrating with the internals of Rackunit. -- sam th sa...@ccs.neu.edu _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] TR - no source locations?
Do you have a sample program where Racket preserves source locations and Typed Racket doesn't? Carl Eastlund On Sat, Nov 20, 2010 at 1:51 PM, John Clements cleme...@brinckerhoff.org wrote: It appears to me that TR does not preserve source locations, which makes testing extremely painful (which test failed? Who knows.) I'm hoping that I'm just missing something obvious, here. I'm also in the market for obvious workarounds. Apologies if this is a FAQ; I did actually google for the answer. John _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] TR - no source locations?
There are a lot of things you could mean by Typed Racket doesn't preserve source locations. Some of them TR definitely preserves source locations, and some are hard cases where TR tries but doesn't always succeed. So I am also interested in an example. On Sat, Nov 20, 2010 at 1:55 PM, Carl Eastlund c...@ccs.neu.edu wrote: Do you have a sample program where Racket preserves source locations and Typed Racket doesn't? Carl Eastlund On Sat, Nov 20, 2010 at 1:51 PM, John Clements cleme...@brinckerhoff.org wrote: It appears to me that TR does not preserve source locations, which makes testing extremely painful (which test failed? Who knows.) I'm hoping that I'm just missing something obvious, here. I'm also in the market for obvious workarounds. Apologies if this is a FAQ; I did actually google for the answer. John -- sam th sa...@ccs.neu.edu _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev