[racket-dev] for loop singleton optimization

2012-11-28 Thread J. Ian Johnson
It would be great to optimize singletons out of comprehensions, since I (and probably others) have macros that expand into singleton constructors that are much better suited to just be a rebinding. (time (for ([n (in-range 1 100)]) (for ([k (in-set (set n))]) (random k cpu time: 340

Re: [racket-dev] for loop singleton optimization

2012-11-28 Thread Matthew Flatt
I think that would be an ad hoc optimization in each `in-'. For example, (define-sequence-syntax *in-set (lambda () #'in-set) (lambda (stx) (syntax-case stx () [[(id) (_ st)] in `racket/set' could change to (define-sequence-syntax *in-set (lambda () #'in-set)

Re: [racket-dev] for loop singleton optimization

2012-11-28 Thread J. Ian Johnson
Cool. I submitted a pull request with this change since it's always an improvement. Thanks, -Ian - Original Message - From: Matthew Flatt mfl...@cs.utah.edu To: J. Ian Johnson i...@ccs.neu.edu Cc: dev dev@racket-lang.org Sent: Wednesday, November 28, 2012 12:58:09 PM GMT -05:00 US/Canada

Re: [racket-dev] [racket-bug] all/13315: TR error messages from raco setup unhelpful

2012-11-28 Thread Asumu Takikawa
Note: taking this to dev since my reply isn't directly relevant to the bug report. On 2012-11-28 05:00:02 -0500, sper...@deinprogramm.de wrote: *** Description: So I tried to resurrect the tr-pfds collection with purely functional data structures. It's not quite up to data with the current

[racket-dev] The `var` pattern in `match`

2012-11-28 Thread Sam Tobin-Hochstadt
Currently, `match` provides a pattern named `var`, which makes `(var id)` equivalent to `id`, but without special cases for things like `_` and `...`. However, this frequently conflicts with structures that people define, and is rarely used other than accidentally. I'd therefore like to remove

Re: [racket-dev] The `var` pattern in `match`

2012-11-28 Thread David Van Horn
On 11/28/12 7:53 PM, Sam Tobin-Hochstadt wrote: Currently, `match` provides a pattern named `var`, which makes `(var id)` equivalent to `id`, but without special cases for things like `_` and `...`. However, this frequently conflicts with structures that people define, and is rarely used other

Re: [racket-dev] Feature request: documentation arrow in DrRacket

2012-11-28 Thread Robby Findler
Yes, it would! In the meantime, you can type #'for* and that'll trigger the docs. The issue is that the documentation is built based on a non-error expansion of the program. Until we change how that works, there won't be any of the online check syntax information for parts that are

Re: [racket-dev] The `var` pattern in `match`

2012-11-28 Thread Neil Toronto
On 11/28/2012 06:04 PM, David Van Horn wrote: On 11/28/12 7:53 PM, Sam Tobin-Hochstadt wrote: Currently, `match` provides a pattern named `var`, which makes `(var id)` equivalent to `id`, but without special cases for things like `_` and `...`. However, this frequently conflicts with

[racket-dev] TR: Is there a type for this?

2012-11-28 Thread Neil Toronto
I'm trying to give the `flvector-map' function a sensible type. A stubbed-out attempt follows, along with an application of it that fails typechecking. #lang typed/racket (require racket/flonum) (: flvector-map (case- ((Flonum - Flonum) FlVector - FlVector) ((Flonum Flonum