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
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)
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
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
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
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
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
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
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
9 matches
Mail list logo