[racket-dev] [plt] Push #25789: master branch updated
Thanks, Matthew. I should have added an empty set case too, since that allocates (as opposed to list and mlist). Submitted another pull request (this time with a test, sorry about that).
-Ian
----- Original Message -----
From: mflatt at racket-lang.org
To: dev at racket-lang.org
Sent: Thursday, November 29, 2012 9:20:22 AM GMT -05:00 US/Canada Eastern
Subject: [plt] Push #25789: master branch updated
mflatt has updated `master' from 15cbfa1947 to bd16f1e302.
http://git.racket-lang.org/plt/15cbfa1947..bd16f1e302
=====[ 4 Commits ]======================================================
Directory summary:
25.1% collects/racket/private/
11.7% collects/racket/
32.6% collects/scribble/
10.3% collects/scribblings/main/private/
20.1% collects/tests/racket/
~~~~~~~~~~
889f159 J. Ian Johnson <ianj at ccs.neu.edu> 2012-11-28 13:05
:
| Singleton optimization for sequences that would allocate.
:
M collects/racket/private/for.rkt | 6 ++++--
M collects/racket/set.rkt | 3 ++-
~~~~~~~~~~
6bfc03d Matthew Flatt <mflatt at racket-lang.org> 2012-11-29 06:57
:
| add tests for `in-list', `in-mlist', and `in-set' shortcut
:
M collects/tests/racket/for.rktl | 4 ++++
M collects/tests/racket/set.rktl | 1 +
~~~~~~~~~~
d6b0dfc Sam Tobin-Hochstadt <samth at racket-lang.org> 2012-11-28 14:14
:
| Switch to use almost-standard DOCTYPE for Scribble.
|
| Also switches scribble search trampoline to standard DOCTYPE.
|
| Scribble's HTML output currently relies on the quirks-mode
| box model for layout of the many tables used in rendering.
| However, Scribble doesn't need the rest of the changes in
| browser quirks modes, so we choose a DOCTYPE that just
| changes the box model.
|
| It's non-obvious how to replicated this formatting with CSS
| in standard-mode rendering. Probably a better long term
| solution is to move away from table-based layout.
|
| See further discussion on GitHub pull request 158 here:
| https://github.com/plt/racket/pull/158
:
M collects/scribble/scribble-prefix.html | 2 +-
M collects/scribblings/main/private/search-context.html | 2 +-
~~~~~~~~~~
bd16f1e Matthew Flatt <mflatt at racket-lang.org> 2012-11-29 07:18
:
| scribble HTML: no extra breaking at the end of an identifier
:
M collects/scribble/html-render.rkt | 2 +-
=====[ Overall Diff ]===================================================
collects/racket/private/for.rkt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- OLD/collects/racket/private/for.rkt
+++ NEW/collects/racket/private/for.rkt
@@ -1725,7 +1725,8 @@
(define-sequence-syntax *in-list
(lambda () #'in-list)
(lambda (stx)
- (syntax-case stx ()
+ (syntax-case stx (list)
+ [[(id) (_ (list expr))] #'[(id) (:do-in ([(id) expr]) #t () #t () #t #f ())]]
[[(id) (_ lst-expr)]
(for-clause-syntax-protect
#'[(id)
@@ -1751,7 +1752,8 @@
(define-sequence-syntax *in-mlist
(lambda () #'in-mlist)
(lambda (stx)
- (syntax-case stx ()
+ (syntax-case stx (mlist)
+ [[(id) (_ (mlist expr))] #'[(id) (:do-in ([(id) expr]) #t () #t () #t #f ())]]
[[(id) (_ lst-expr)]
(for-clause-syntax-protect
#'[(id)
collects/racket/set.rkt
~~~~~~~~~~~~~~~~~~~~~~~
--- OLD/collects/racket/set.rkt
+++ NEW/collects/racket/set.rkt
@@ -308,7 +308,8 @@
(define-sequence-syntax *in-set
(lambda () #'in-set)
(lambda (stx)
- (syntax-case stx ()
+ (syntax-case stx (set)
+ [[(id) (_ (set expr))] #'[(id) (:do-in ([(id) expr]) #t () #t () #t #f ())]]
[[(id) (_ st)]
#`[(id)
(:do-in
collects/scribble/html-render.rkt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- OLD/collects/scribble/html-render.rkt
+++ NEW/collects/scribble/html-render.rkt
@@ -1385,7 +1385,7 @@
(cond
[(string? i)
(let ([m (and (extra-breaking?)
- (regexp-match-positions #rx"[-:/+_]|[a-z](?=[A-Z])" i))])
+ (regexp-match-positions #rx"[-:/+_](?=.)|[a-z](?=[A-Z])" i))])
(if m
(list* (substring i 0 (cdar m))
;; Most browsers wrap after a hyphen. The one that
collects/scribble/scribble-prefix.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- OLD/collects/scribble/scribble-prefix.html
+++ NEW/collects/scribble/scribble-prefix.html
@@ -1 +1 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
collects/scribblings/main/private/search-context.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- OLD/collects/scribblings/main/private/search-context.html
+++ NEW/collects/scribblings/main/private/search-context.html
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html>
<html>
<!--
This page serves as a trampoline - it finds an "hq" parameter,
collects/tests/racket/for.rktl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- OLD/collects/tests/racket/for.rktl
+++ NEW/collects/tests/racket/for.rktl
@@ -51,6 +51,10 @@
(test-sequence [(65 66 67)] (open-input-bytes #"ABC"))
(test-sequence [(65 66 67)] (in-input-port-bytes (open-input-bytes #"ABC")))
+;; Test optimized:
+(test '(2) 'in-list-of-list (for/list ([v (in-list (list 1))]) (add1 v)))
+(test '(0) 'in-mlist-of-mlist (for/list ([v (in-mlist (mlist 1))]) (sub1 v)))
+
(test-sequence [(1 2 3)] (in-port read (open-input-string "1 2 3")))
(test-sequence [((123) 4)] (in-port read (open-input-string "(123) 4")))
(test-sequence [(65 66 67)] (in-port read-byte (open-input-string "ABC")))
collects/tests/racket/set.rktl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- OLD/collects/tests/racket/set.rktl
+++ NEW/collects/tests/racket/set.rktl
@@ -105,6 +105,7 @@
(test '(1 2 3) sort (for/list ([v s]) v) <)
(test '(1 2 3) sort (for/list ([v (in-set s)]) v) <)
(test '(1 2 3) sort (let ([seq (in-set s)]) (for/list ([v seq]) v)) <)
+ (test '(1) sort (for/list ([v (in-set (set 1))]) v) <)
(void))