Fix lots of indentation mistakes.

(Found by my ayatollah script...)
This commit is contained in:
Eli Barzilay 2013-03-14 07:15:43 -04:00
parent 71d6189132
commit af6be85ff5
140 changed files with 2040 additions and 2223 deletions

View File

@ -146,8 +146,11 @@
(map (lambda (extra) (map (lambda (extra)
(if (identifier? extra) (if (identifier? extra)
(make-a60:type-decl (->stx 'integer) (list extra)) (make-a60:type-decl (->stx 'integer) (list extra))
(make-a60:switch-decl (car extra) (map (lambda (x) (make-a60:switch-decl
(make-a60:variable (datum->syntax-object #f x) null)) (car extra)
(map (lambda (x)
(make-a60:variable (datum->syntax-object #f x)
null))
(cdr extra))))) (cdr extra)))))
extra-decls)) extra-decls))
(if (null? new-statements) (if (null? new-statements)
@ -155,10 +158,7 @@
new-statements))) new-statements)))
(define (simplify stmt ctx) (define (simplify stmt ctx)
(simplify-statement stmt (lambda (x) (simplify-statement stmt (lambda (x) (datum->syntax-object ctx x))))
(datum->syntax-object
ctx
x))))
(define (simplify-statement stmt ->stx) (define (simplify-statement stmt ->stx)
(match stmt (match stmt

View File

@ -116,14 +116,16 @@
(let ([init (parameterize ([current-directory dir] (let ([init (parameterize ([current-directory dir]
[current-load-relative-directory dir] [current-load-relative-directory dir]
;; Verbose compilation manager: ;; Verbose compilation manager:
[manager-trace-handler (if verbose? [manager-trace-handler
(if verbose?
(let ([op (current-output-port)]) (let ([op (current-output-port)])
(lambda (s) (fprintf op "~a\n" s))) (lambda (s) (fprintf op "~a\n" s)))
(manager-trace-handler))] (manager-trace-handler))]
[manager-compile-notify-handler [manager-compile-notify-handler
(lambda (path) ((compile-notify-handler) path))] (lambda (path) ((compile-notify-handler) path))]
[manager-skip-file-handler [manager-skip-file-handler
(lambda (path) (and skip-path (lambda (path)
(and skip-path
(let ([b (path->bytes (simplify-path path #f))] (let ([b (path->bytes (simplify-path path #f))]
[len (bytes-length skip-path)]) [len (bytes-length skip-path)])
(and ((bytes-length b) . > . len) (and ((bytes-length b) . > . len)

View File

@ -59,9 +59,7 @@ itself.
(define (update-buttons) (define (update-buttons)
(send resume-b enable (and current-sampler (not running?))) (send resume-b enable (and current-sampler (not running?)))
(send pause-b enable (and current-sampler running?)) (send pause-b enable (and current-sampler running?))
(send start-stop-b set-label (if current-sampler (send start-stop-b set-label (if current-sampler "Stop" "Start")))
"Stop"
"Start")))
(define running? #f) (define running? #f)
(define current-sampler #f) (define current-sampler #f)

View File

@ -25,9 +25,9 @@
[-get-file get-file])) [-get-file get-file]))
(init-depend mred^) (init-depend mred^)
;; if I put this in main.rkt with the others, it doesn't happen ;; if I put this in main.rkt with the others, it doesn't happen
;; early enough... ? JBC, 2011-07-12 ;; early enough... ? JBC, 2011-07-12
(preferences:set-default 'framework:automatic-parens #f boolean?) (preferences:set-default 'framework:automatic-parens #f boolean?)
(define user-keybindings-files (make-hash)) (define user-keybindings-files (make-hash))
@ -931,8 +931,8 @@
(λ (adjust) (λ (adjust)
(λ (text event) (λ (text event)
(when (is-a? text editor:basic<%>) (when (is-a? text editor:basic<%>)
(let ([frame (send text get-top-level-window)]) (let ([frame (send text get-top-level-window)]
(let ([found-one? #f]) [found-one? #f])
(let/ec k (let/ec k
(let ([go (let ([go
(λ () (λ ()
@ -952,7 +952,7 @@
;;; or the last editor-canvas had the focus. either way, ;;; or the last editor-canvas had the focus. either way,
;;; the next thing should get the focus ;;; the next thing should get the focus
(set! found-one? #t) (set! found-one? #t)
(go))))))))] (go)))))))]
[TeX-compress [TeX-compress
(let* ([biggest (apply max (map (λ (x) (string-length (car x))) tex-shortcut-table))]) (let* ([biggest (apply max (map (λ (x) (string-length (car x))) tex-shortcut-table))])

View File

@ -525,12 +525,12 @@
(define horizontal-dragable% (horizontal-dragable-mixin (dragable-mixin panel%))) (define horizontal-dragable% (horizontal-dragable-mixin (dragable-mixin panel%)))
(define splitter<%> (interface () split-horizontal split-vertical collapse)) (define splitter<%> (interface () split-horizontal split-vertical collapse))
;; we need a private interface so we can use `generic' because `generic' ;; we need a private interface so we can use `generic' because `generic'
;; doesn't work on mixins ;; doesn't work on mixins
(define splitter-private<%> (interface () self-vertical? self-horizontal?)) (define splitter-private<%> (interface () self-vertical? self-horizontal?))
(define splitter-mixin (define splitter-mixin
(mixin (area-container<%> dragable<%>) (splitter<%> splitter-private<%>) (mixin (area-container<%> dragable<%>) (splitter<%> splitter-private<%>)
(super-new) (super-new)
(inherit get-children add-child (inherit get-children add-child

View File

@ -6,10 +6,7 @@
(module math frtime/frtime-lang-only (module math frtime/frtime-lang-only
(require (only-in racket/math pi sqr sgn conjugate sinh cosh)) (require (only-in racket/math pi sqr sgn conjugate sinh cosh))
(provide (lifted (provide (lifted sqr sgn conjugate sinh cosh))
sqr
sgn conjugate
sinh cosh))
(provide pi e) (provide pi e)

View File

@ -211,7 +211,8 @@
[last-x 0] [last-x 0]
[ticks '()] [ticks '()]
[last-label-x-extent 0] [last-label-x-extent 0]
[remain-segs segs]) ([i (in-range 0 (floor (/ (- (trace-end-time tr) [remain-segs segs])
([i (in-range 0 (floor (/ (- (trace-end-time tr)
trace-start) trace-start)
DEFAULT-TIME-INTERVAL)))]) DEFAULT-TIME-INTERVAL)))])
(define tick-rel-time (* (add1 i) DEFAULT-TIME-INTERVAL)) (define tick-rel-time (* (add1 i) DEFAULT-TIME-INTERVAL))

View File

@ -228,7 +228,7 @@
(require (for-meta 2 (submod "." analysis))) (require (for-meta 2 (submod "." analysis)))
(begin-for-syntax (begin-for-syntax
(define-syntax (parse-stuff stx) (define-syntax (parse-stuff stx)
(syntax-parse stx (syntax-parse stx
[(_ stuff ...) [(_ stuff ...)
(emit-remark "Parse stuff ~a\n" #'(stuff ...)) (emit-remark "Parse stuff ~a\n" #'(stuff ...))

View File

@ -635,8 +635,7 @@
(parse (strip-stops code))) (parse (strip-stops code)))
(define parsed (if (parsed-syntax? parsed-original) (define parsed (if (parsed-syntax? parsed-original)
parsed-original parsed-original
(let-values ([(out rest) (let-values ([(out rest) (parse parsed-original)])
(parse parsed-original)])
(when (not (empty-syntax? rest)) (when (not (empty-syntax? rest))
(raise-syntax-error 'parse-all "expected no more syntax" parsed-original)) (raise-syntax-error 'parse-all "expected no more syntax" parsed-original))
out))) out)))

View File

@ -382,8 +382,7 @@
(list (bitmap->pixbuf big-icon)) (list (bitmap->pixbuf big-icon))
(cdr (car (force icon-pixbufs+glist))))]) (cdr (car (force icon-pixbufs+glist))))])
(atomically (atomically
(let ([l (for/fold ([l #f]) ([i (cons small-pixbuf (let ([l (for/fold ([l #f]) ([i (cons small-pixbuf big-pixbufs)])
big-pixbufs)])
(g_list_insert l i -1))]) (g_list_insert l i -1))])
(gtk_window_set_icon_list gtk l) (gtk_window_set_icon_list gtk l)
(g_list_free l)))))) (g_list_free l))))))

View File

@ -345,7 +345,8 @@
[(1) 'left-up] [(1) 'left-up]
[(3) 'right-up] [(3) 'right-up]
[else 'middle-up])])] [else 'middle-up])])]
[m (let-values ([(x y) (send wx [m (let-values ([(x y)
(send wx
adjust-event-position adjust-event-position
(->long ((if motion? (->long ((if motion?
GdkEventMotion-x GdkEventMotion-x

View File

@ -372,9 +372,7 @@ TO DO:
(define-syntax with-failure (define-syntax with-failure
(syntax-rules () (syntax-rules ()
[(_ thunk body ...) [(_ thunk body ...)
(with-handlers ([exn? (lambda (exn) (with-handlers ([exn? (lambda (exn) (thunk) (raise exn))])
(thunk)
(raise exn))])
body ...)])) body ...)]))
(define (get-error-message id) (define (get-error-message id)

View File

@ -9,7 +9,8 @@
(provide/contract (provide/contract
(build-parser ((string? any/c any/c (listof identifier?) (listof identifier?) (build-parser ((string? any/c any/c (listof identifier?) (listof identifier?)
(listof identifier?) (union syntax? false/c) syntax?) . ->* . (listof identifier?) (union syntax? false/c) syntax?)
. ->* .
(any/c any/c any/c any/c)))) (any/c any/c any/c any/c))))
;; fix-check-syntax : (listof identifier?) (listof identifier?) (listof identifier?) ;; fix-check-syntax : (listof identifier?) (listof identifier?) (listof identifier?)

View File

@ -15,7 +15,7 @@
show-it) show-it)
(provide provide all-defined-out all-from-out rename-out except-out (provide provide all-defined-out all-from-out rename-out except-out
prefix-out struct-out) prefix-out struct-out)
(define (show-it img) (define (show-it img)
(check-arg 'show-it (image? img) "image" "first" img) (check-arg 'show-it (image? img) "image" "first" img)

View File

@ -17,10 +17,7 @@
(λ (val) (λ (val)
(if (pred? val) (if (pred? val)
(out val) (out val)
(raise-blame-error blame (raise-blame-error blame val "non-polymorphic value: ~e" val)))
val
"non-polymorphic value: ~e"
val)))
in)))) in))))
(define-struct ∀∃/c (in out pred? name neg?) (define-struct ∀∃/c (in out pred? name neg?)

View File

@ -79,8 +79,7 @@
[1/10 1] [1/10 1]
[else (+ 2 (rand 260))])] [else (+ 2 (rand 260))])]
[bstr (build-list len [bstr (build-list len
(λ (x) (λ (x) (rand 256)))])
(rand 256)))])
(apply bytes bstr))))) (apply bytes bstr)))))

View File

@ -132,10 +132,8 @@
(dplace/place-channel-put ch (log-message severity msg))) (dplace/place-channel-put ch (log-message severity msg)))
(syntax-parameterize ([log-to-parent (make-rename-transformer #'log-to-parent-real)]) (syntax-parameterize ([log-to-parent (make-rename-transformer #'log-to-parent-real)])
(match msg (match msg
cases (... ...) cases (... ...)))
)) loop)))))
loop)
))))
(with-syntax ([mkname (string->id stx (format "make-~a" (id->string #'name)))]) (with-syntax ([mkname (string->id stx (format "make-~a" (id->string #'name)))])
(define x (define x
#`(begin #`(begin
@ -156,5 +154,3 @@ x)]))
(provide define-remote-server (provide define-remote-server
define-named-remote-server define-named-remote-server
log-to-parent) log-to-parent)

View File

@ -143,7 +143,8 @@
(define (which cmd) (define (which cmd)
(define path (getenv "PATH")) (define path (getenv "PATH"))
(and path (and path
(exists? (map (lambda (x) (build-path x cmd)) (regexp-split (case (system-type 'os) (exists? (map (lambda (x) (build-path x cmd))
(regexp-split (case (system-type 'os)
[(unix macosx) ":"] [(unix macosx) ":"]
[(windows) "#:;"]) [(windows) "#:;"])
path))))) path)))))

View File

@ -18,13 +18,14 @@
;(place-worker p1) ;(place-worker p1)
(define (main . argv) (define (main . argv)
(define p (place ch (define p
(place ch
(random-seed (current-seconds)) (random-seed (current-seconds))
;(define id (place-channel-get ch)) ;; (define id (place-channel-get ch))
(define id "HI") (define id "HI")
(for ([i (in-range (+ 5 (random 5)))]) (for ([i (in-range (+ 5 (random 5)))])
(displayln (list (current-seconds) id i)) (displayln (list (current-seconds) id i))
(flush-output) (flush-output)
;(place-channel-put ch (list (current-seconds) id i)) ;; (place-channel-put ch (list (current-seconds) id i))
#;(sleep 3)))) #;(sleep 3))))
(sync (handle-evt (place-dead-evt p) (lambda (e) (printf "DEAD\n"))))) (sync (handle-evt (place-dead-evt p) (lambda (e) (printf "DEAD\n")))))

View File

@ -132,9 +132,9 @@
[mapping null] [mapping null]
[ready-to-reduce null] [ready-to-reduce null]
[reducing null]) [reducing null])
;(printf "STATE\n") ;; (printf "STATE\n")
;(pretty-print (list ts idle-mappers mapping ready-to-reduce reducing)) ;; (pretty-print (list ts idle-mappers mapping ready-to-reduce reducing))
;(flush-output) ;; (flush-output)
(match (list ts idle-mappers mapping ready-to-reduce reducing) (match (list ts idle-mappers mapping ready-to-reduce reducing)
[(list (cons tsh tst) (cons imh imt) mapping rtr r) [(list (cons tsh tst) (cons imh imt) mapping rtr r)
(*channel-put (second imh) (list 'map mapper sorter (list tsh))) (*channel-put (second imh) (list 'map mapper sorter (list tsh)))
@ -146,7 +146,8 @@
(*channel-put (second rtr) (list 'get-results)) (*channel-put (second rtr) (list 'get-results))
(second (*channel-get (second rtr)))] (second (*channel-get (second rtr)))]
[else ; wait [else ; wait
(apply sync/enable-break (for/list ([m (append mapping reducing)]) (apply sync/enable-break
(for/list ([m (append mapping reducing)])
(wrap-evt (second m) (wrap-evt (second m)
(lambda (e) (lambda (e)
(match e (match e
@ -159,8 +160,3 @@
(or (and outputer ((apply-dynamic-require outputer) result)) (or (and outputer ((apply-dynamic-require outputer) result))
result)) result))

View File

@ -258,10 +258,11 @@
(partit num cnt id)) (partit num cnt id))
(define rmpi-build-default-config (define rmpi-build-default-config
(make-keyword-procedure (lambda (kws kw-args . rest) (make-keyword-procedure
(lambda (kws kw-args . rest)
(for/hash ([kw kws] (for/hash ([kw kws]
[kwa kw-args]) [kwa kw-args])
; (displayln (keyword? kw)) ;; (displayln (keyword? kw))
(values kw kwa))))) (values kw kwa)))))
(define (rmpi-launch default config #:no-wait [no-wait #f]) (define (rmpi-launch default config #:no-wait [no-wait #f])

View File

@ -133,8 +133,7 @@
(define (tests->test-suite-action tests) (define (tests->test-suite-action tests)
(lambda (fdown fup fhere seed) (lambda (fdown fup fhere seed)
(parameterize (parameterize ([current-seed seed])
([current-seed seed])
(for-each (for-each
(lambda (t) (lambda (t)
(cond (cond

View File

@ -705,8 +705,7 @@
(l! lx x_1) ... (l! lx x_1) ...
(r6rs-subst-many ((x_1 lx) ... e_2)) (r6rs-subst-many ((x_1 lx) ... e_2))
(r6rs-subst-many ((x_1 lx) ... e_3)) ...) (r6rs-subst-many ((x_1 lx) ... e_3)) ...)
(begin0 (begin0 (r6rs-subst-many ((x_1 lx) ... e_1))
(r6rs-subst-many ((x_1 lx) ... e_1))
(reinit ri)) (reinit ri))
...))) ...)))
"6letrec" "6letrec"

View File

@ -74,7 +74,8 @@
; the reduction graph produces a cutoff result; with it ; the reduction graph produces a cutoff result; with it
; a cylce produces a pending, which is treated identically. ; a cylce produces a pending, which is treated identically.
(hash-set! cache s (cons c 'pending)) (hash-set! cache s (cons c 'pending))
(let ([r (cond [(term (halted? ,s)) (let ([r
(cond [(term (halted? ,s))
(make-answer (make-answer
(if (eq? s 'error) (if (eq? s 'error)
'error 'error

View File

@ -422,7 +422,8 @@
(define (ybase-sum) (/ yscale-base (- 1 yscale-base))) (define (ybase-sum) (/ yscale-base (- 1 yscale-base)))
(define (find-ybase-center) (define (find-ybase-center)
(define mid (/ (ybase-sum) 2)) (define mid (/ (ybase-sum) 2))
(define sums (for/hash ([i 10]) (values (abs (- mid (define sums (for/hash ([i 10])
(values (abs (- mid
(apply + (for/list ([k i]) (apply + (for/list ([k i])
(expt yscale-base i))))) (expt yscale-base i)))))
i))) i)))
@ -679,7 +680,8 @@
(define/private (map-y-int y) (define/private (map-y-int y)
(hash-ref map-y-int-memo y (hash-ref map-y-int-memo y
(λ () (λ ()
(define res (if (< 0 y) (define res
(if (< 0 y)
(+ Y-SHIFT (* (apply + (for/list ([i (in-range 1 y)]) (+ Y-SHIFT (* (apply + (for/list ([i (in-range 1 y)])
(expt yscale-base i))) (expt yscale-base i)))
y-scale)) y-scale))

View File

@ -25,4 +25,3 @@
#'@defmethod*[(((method (orig (is-a?/c text%)) (call-inner (-> any)) (x any/c) ...) any) ...)]{ #'@defmethod*[(((method (orig (is-a?/c text%)) (call-inner (-> any)) (x any/c) ...) any) ...)]{
Returns the result of invoking @racket[call-super]. Returns the result of invoking @racket[call-super].
}])) }]))

View File

@ -87,12 +87,13 @@
method should be used instead during undoable edit sequences.}) method should be used instead during undoable edit sequences.})
(define (insertscrolldetails what) (define (insertscrolldetails what)
@elem{@|what| editor's display is scrolled to show the new selection @techlink{position}.}) @elem{@|what| editor's display is scrolled to show the new selection
@techlink{position}.})
(define (insertmovedetails what) (define (insertmovedetails what)
@elem{If the insertion @techlink{position} is before @elem{If the insertion @techlink{position} is before
or equal to the selection's start/end @techlink{position}, then the selection's or equal to the selection's start/end @techlink{position}, then the
start/end @techlink{position} is incremented by @|what|.}) selection's start/end @techlink{position} is incremented by @|what|.})
(define OVD (define OVD
@elem{The result is only valid when the editor is displayed @elem{The result is only valid when the editor is displayed
@ -100,9 +101,10 @@ start/end @techlink{position} is incremented by @|what|.})
@method[editor<%> get-admin] returns an administrator (not @racket[#f]).}) @method[editor<%> get-admin] returns an administrator (not @racket[#f]).})
(define (FCAX c details) (define (FCAX c details)
@elem{@|c|alling this method may force the recalculation of @techlink{location} @elem{
information@|details|, even if the editor currently has delayed refreshing (see @|c|alling this method may force the recalculation of @techlink{location}
@method[editor<%> refresh-delayed?]).}) information@|details|, even if the editor currently has delayed
refreshing (see @method[editor<%> refresh-delayed?]).})
(define FCA (FCAX "C" "")) (define FCA (FCAX "C" ""))
(define FCAMW (FCAX "C" " if a maximum width is set for the editor")) (define FCAMW (FCAX "C" " if a maximum width is set for the editor"))
@ -180,11 +182,14 @@ information@|details|, even if the editor currently has delayed refreshing (see
@elem{The editor's style list must contain @style, otherwise @elem{The editor's style list must contain @style, otherwise
the style is not changed. See also @xmethod[style-list% convert].}) the style is not changed. See also @xmethod[style-list% convert].})
(define (FontKWs font) @elem{The @|font| argument determines the font for the control.}) (define (FontKWs font)
(define (FontLabelKWs font label-font) @elem{The @|font| argument determines the font for the control content, @elem{The @|font| argument determines the font for the control.})
(define (FontLabelKWs font label-font)
@elem{The @|font| argument determines the font for the control content,
and @|label-font| determines the font for the control label.}) and @|label-font| determines the font for the control label.})
(define (WindowKWs enabled) @elem{For information about the @|enabled| argument, see @racket[window<%>].}) (define (WindowKWs enabled)
@elem{For information about the @|enabled| argument, see @racket[window<%>].})
(define-inline (SubareaKWs) (define-inline (SubareaKWs)
@elem{For information about the @racket[horiz-margin] and @racket[vert-margin] @elem{For information about the @racket[horiz-margin] and @racket[vert-margin]
arguments, see @racket[subarea<%>].}) arguments, see @racket[subarea<%>].})

View File

@ -63,15 +63,12 @@
@section[#:tag (string-append section-prefix " Pre-Defined Variables")]{Pre-Defined Variables} @section[#:tag (string-append section-prefix " Pre-Defined Variables")]{Pre-Defined Variables}
@defthing[empty empty?]{ @defthing[empty empty?]{
The empty list.} The empty list.}
@defthing[true boolean?]{ @defthing[true boolean?]{
The true value.} The true value.}
@defthing[false boolean?]{ @defthing[false boolean?]{
The false value.} The false value.}
@section[#:tag (string-append section-prefix " Template Variables")]{Template Variables} @section[#:tag (string-append section-prefix " Template Variables")]{Template Variables}

View File

@ -85,14 +85,16 @@
(define/public (send/msg msg) (define/public (send/msg msg)
(with-handlers ([exn:fail? (with-handlers ([exn:fail?
(lambda (x) (lambda (x)
(eprintf "While sending message to parallel-do worker: ~a ~a\n" id (exn-message x)) (eprintf "While sending message to parallel-do worker: ~a ~a\n"
id (exn-message x))
(exit 1))]) (exit 1))])
(DEBUG_COMM (eprintf "CSENDING ~v ~v\n" id msg)) (DEBUG_COMM (eprintf "CSENDING ~v ~v\n" id msg))
(write msg in) (flush-output in))) (write msg in) (flush-output in)))
(define/public (recv/msg) (define/public (recv/msg)
(with-handlers ([exn:fail? (with-handlers ([exn:fail?
(lambda (x) (lambda (x)
(eprintf "While receiving message from parallel-do worker ~a ~a\n" id (exn-message x)) (eprintf "While receiving message from parallel-do worker ~a ~a\n"
id (exn-message x))
(exit 1))]) (exit 1))])
(define r (read out)) (define r (read out))
(DEBUG_COMM (eprintf "CRECEIVNG ~v ~v\n" id r)) (DEBUG_COMM (eprintf "CRECEIVNG ~v ~v\n" id r))

View File

@ -34,9 +34,9 @@
#:key #:key
[with-gl (lambda (f) (f))] [with-gl (lambda (f) (f))]
[mask (send bm get-loaded-mask)]) [mask (send bm get-loaded-mask)])
(let ([w (send bm get-width)] (define w (send bm get-width))
[h (send bm get-height)] (define h (send bm get-height))
[rgba (argb->rgba (bitmap->argb bm mask))]) (define rgba (argb->rgba (bitmap->argb bm mask)))
(with-gl (with-gl
(lambda () (lambda ()
(let ((tex (gl-vector-ref (glGenTextures 1) 0)) (let ((tex (gl-vector-ref (glGenTextures 1) 0))
@ -67,4 +67,4 @@
(gl-disable 'texture-2d) (gl-disable 'texture-2d)
(gl-end-list) (gl-end-list)
list-id)))))) list-id)))))

View File

@ -570,8 +570,11 @@
attached)) attached))
(define (values-map fn . lsts) (define (values-map fn . lsts)
(apply values (apply map list (apply values
(apply map (lambda args (call-with-values (lambda () (apply fn args)) list)) (apply map list
(apply map (lambda args
(call-with-values (lambda () (apply fn args))
list))
lsts)))) lsts))))
; produces the list of numbers from a to b (inclusive) ; produces the list of numbers from a to b (inclusive)

View File

@ -174,7 +174,8 @@ please adhere to these guidelines:
(saved-unsubmitted-bug-reports "Saved, unsubmitted bug reports:") (saved-unsubmitted-bug-reports "Saved, unsubmitted bug reports:")
;; the above string constant is next to previous line in same dialog, followed by list of bug report subjects (as buttons) ;; the above string constant is next to previous line in same dialog, followed by list of bug report subjects (as buttons)
(error-sending-bug-report "Error Sending Bug Report") (error-sending-bug-report "Error Sending Bug Report")
(error-sending-bug-report-expln "An error occurred when sending this bug report." (error-sending-bug-report-expln
"An error occurred when sending this bug report."
" If your internet connection is otherwise working fine, please visit:\n\n http://bugs.racket-lang.org/\n\nand" " If your internet connection is otherwise working fine, please visit:\n\n http://bugs.racket-lang.org/\n\nand"
" submit the bug via our online web-form. Sorry for the difficulties.\n\nThe error message is:\n~a") " submit the bug via our online web-form. Sorry for the difficulties.\n\nThe error message is:\n~a")
(illegal-bug-report "Illegal Bug Report") (illegal-bug-report "Illegal Bug Report")

View File

@ -27,19 +27,18 @@
(hash-set! rx-keys rx (make-ephemeron rx bstr)) (hash-set! rx-keys rx (make-ephemeron rx bstr))
rx)))) rx))))
(define (scribble-inside-lexer orig-in offset mode) (define (scribble-inside-lexer orig-in offset orig-mode)
(let ([mode (or mode (define mode (or orig-mode
(list (list
(make-text #rx"^@" (make-text #rx"^@"
#f #f
#f #f
#rx".*?(?:(?=[@\r\n])|$)" #rx".*?(?:(?=[@\r\n])|$)"
#f #f
#f)))] #f))))
[in (special-filter-input-port orig-in (define in (special-filter-input-port
(lambda (v s) orig-in
(bytes-set! s 0 (char->integer #\.)) (lambda (v s) (bytes-set! s 0 (char->integer #\.)) 1)))
1))])
(let-values ([(line col pos) (port-next-location orig-in)]) (let-values ([(line col pos) (port-next-location orig-in)])
(when line (when line
(port-count-lines! in))) (port-count-lines! in)))
@ -362,7 +361,7 @@
(enter-simple-opener (cdr mode))] (enter-simple-opener (cdr mode))]
[else [else
(scribble-inside-lexer in offset (cdr mode))])] (scribble-inside-lexer in offset (cdr mode))])]
[else (error "bad mode")]))))) [else (error "bad mode")]))))
(define (scribble-lexer in offset mode) (define (scribble-lexer in offset mode)
(scribble-inside-lexer in offset (or mode (list (make-scheme 'many #f))))) (scribble-inside-lexer in offset (or mode (list (make-scheme 'many #f)))))

View File

@ -25,10 +25,10 @@
(check-equal? (check-equal?
(capture-output (capture-output
@literal-algol{ @literal-algol{
begin begin
printsln (`hello world') printsln (`hello world')
end end
}) })
'(run "hello world\n" "")) '(run "hello world\n" ""))
(check-pred (check-pred
@ -37,8 +37,8 @@ end
(list-ref x 1)))) (list-ref x 1))))
(capture-output (capture-output
@literal-algol{ @literal-algol{
begin begin
})) }))
(check-pred (check-pred
@ -47,9 +47,9 @@ begin
(list-ref x 1)))) (list-ref x 1))))
(capture-output (capture-output
@literal-algol{ @literal-algol{
procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k); procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
value n, m; array a; integer n, m, i, k; real y; value n, m; array a; integer n, m, i, k; real y;
begin integer p, q; begin integer p, q;
y := 0; i := k := 1; y := 0; i := k := 1;
for p:=1 step 1 until n do for p:=1 step 1 until n do
for q:=1 step 1 until m do for q:=1 step 1 until m do
@ -57,4 +57,5 @@ begin integer p, q;
begin y := abs(a[p, q]); begin y := abs(a[p, q]);
i := p; k := q i := p; k := q
end end
end Absmax})) end Absmax
}))

View File

@ -55,7 +55,8 @@
(define (kill-safe-test proxy?) (define (kill-safe-test proxy?)
(unless (ANYFLAGS 'isora 'isdb2) (unless (ANYFLAGS 'isora 'isdb2)
(test-case (format "kill-safe test~a" (if proxy? " (proxy)" "")) (test-case
(format "kill-safe test~a" (if proxy? " (proxy)" ""))
(call-with-connection (call-with-connection
(lambda (c0) (lambda (c0)
(let ([c (if proxy? (let ([c (if proxy?

View File

@ -233,7 +233,8 @@
(define labels (define labels
(let* ([all-info (call-with-input-file (build-path (collection-path "solutions") (let* ([all-info (call-with-input-file (build-path (collection-path "solutions")
'up 'up "proj" "book" "solutions" 'up 'up "proj" "book" "solutions"
"labels.scm") read)] "labels.scm")
read)]
[ex-labels (filter (lambda (x) (and (string=? (substring (car x) 0 3) "ex:") [ex-labels (filter (lambda (x) (and (string=? (substring (car x) 0 3) "ex:")
(> (string-length (car x)) 3))) (> (string-length (car x)) 3)))
all-info)]) all-info)])

View File

@ -24,19 +24,13 @@
(let ([vr (viewable-region 3 3 500 500)]) (let ([vr (viewable-region 3 3 500 500)])
(for ([i (in-range 4 503)]) (for ([i (in-range 4 503)])
(check-true (in-viewable-region-horiz vr i) (check-true (in-viewable-region-horiz vr i)
(format "~a should be in ~a" (format "~a should be in ~a" i vr)))
i
vr)))
(for ([i (in-range 0 2)]) (for ([i (in-range 0 2)])
(check-false (in-viewable-region-horiz vr i) (check-false (in-viewable-region-horiz vr i)
(format "~a should not be in ~a" (format "~a should not be in ~a" i vr))
i
vr))
(for ([i (in-range 504 1000)]) (for ([i (in-range 504 1000)])
(check-false (in-viewable-region-horiz vr i) (check-false (in-viewable-region-horiz vr i)
(format "~a should not be in ~a" (format "~a should not be in ~a" i vr)))))
i
vr)))))
(let ([vr (viewable-region 0 0 732 685)]) (let ([vr (viewable-region 0 0 732 685)])
(check-true (in-viewable-region-horiz vr 10)) (check-true (in-viewable-region-horiz vr 10))

View File

@ -14,7 +14,7 @@
(struct xml:object (tag elements)) (struct xml:object (tag elements))
(begin-for-syntax (begin-for-syntax
(define (debug . x) (define (debug . x)
(void) (void)
#; #;
(apply printf x))) (apply printf x)))

View File

@ -30,16 +30,14 @@
; this is the same test for match-lambda ; this is the same test for match-lambda
(mytest (letrec ((z (mytest (letrec ((z (match-lambda ((a b c)
(match-lambda ((a b c)
(if (= a 10) (if (= a 10)
(list a b c) (list a b c)
(cons a (z (list (add1 a) 2 3)))))))) (cons a (z (list (add1 a) 2 3))))))))
(z '(1 2 3))) (z '(1 2 3)))
'(1 2 3 4 5 6 7 8 9 10 2 3)) '(1 2 3 4 5 6 7 8 9 10 2 3))
(mytest (letrec ((z (mytest (letrec ((z (match-lambda* ((a b c)
(match-lambda* ((a b c)
(if (= a 10) (if (= a 10)
(list a b c) (list a b c)
(cons a (z (add1 a) 2 3))))))) (cons a (z (add1 a) 2 3)))))))
@ -66,7 +64,7 @@
(cons a (hey (list (add1 a) b c) '(d e f))))) (cons a (hey (list (add1 a) b c) '(d e f)))))
'(1 2 3 4 5 6 7 8 9)) '(1 2 3 4 5 6 7 8 9))
(mytest (let ((f 7)) (mytest (let ((f 7))
(match-let ([(a b c) (list 1 2 f)] [(d e) '(5 6)]) (list a d c f))) (match-let ([(a b c) (list 1 2 f)] [(d e) '(5 6)]) (list a d c f)))
'(1 5 7 7)) '(1 5 7 7))
@ -145,8 +143,7 @@
; this is some thing that I missed before ; this is some thing that I missed before
(mytest (match '((1) (2) (3)) (mytest (match '((1) (2) (3)) (((_) ...) 'hey))
(((_) ...) 'hey))
'hey) 'hey)
; failure tests ; failure tests
@ -161,13 +158,12 @@
((a b c) (list a b c))) ((a b c) (list a b c)))
'(1 2 3)) '(1 2 3))
;(mytest (match '(1 2 3) ; (mytest (match '(1 2 3)
; ((a b c) (=> fail) (if (= a 1) (fail) 'bad))) ; ((a b c) (=> fail) (if (= a 1) (fail) 'bad)))
; '()) ; this should through a different exception ; '()) ; this should through a different exception
; set! tests ; set! tests
; set! for lists ; set! for lists
@ -231,34 +227,29 @@
;; set! for vectors ;; set! for vectors
(mytest (let ((x (vector 1 2))) (mytest (let ((x (vector 1 2)))
(match x (match x (#(_ (set! set-it)) (set-it 17)))
(#(_ (set! set-it)) (set-it 17)))
x) x)
#(1 17)) #(1 17))
(mytest (let ((x (vector 1 2))) (mytest (let ((x (vector 1 2)))
(match x (match x (#((set! set-it) _) (set-it 17)))
(#((set! set-it) _) (set-it 17)))
x) x)
#(17 2)) #(17 2))
;; set! for boxes ;; set! for boxes
(mytest (let ((x (box 1))) (mytest (let ((x (box 1)))
(match x (match x (#&(set! set-it) (set-it 17)))
(#&(set! set-it) (set-it 17)))
x) x)
#&17) #&17)
#; #;
(mytest (let ((x #&(1 2))) (mytest (let ((x #&(1 2)))
(match x (match x (#&(_ (set! set-it)) (set-it 17)))
(#&(_ (set! set-it)) (set-it 17)))
x) x)
#&(1 17)) #&(1 17))
(mytest (let ((x (box (vector 1 2)))) (mytest (let ((x (box (vector 1 2))))
(match x (match x (#&#(_ (set! set-it)) (set-it 17)))
(#&#(_ (set! set-it)) (set-it 17)))
x) x)
#&#(1 17)) #&#(1 17))
@ -268,133 +259,98 @@
; get! for lists ; get! for lists
#| #|
(mytest (let* ((x '(1 2 (3 4))) (mytest (let* ((x '(1 2 (3 4)))
(f (f (match x ((_ _ ((get! get-it) _)) get-it))))
(match x (match x ((_ _ ((set! set-it) _)) (set-it 17)))
((_ _ ((get! get-it) _)) get-it)))) (f))
(match x 17)
((_ _ ((set! set-it) _)) (set-it 17)))
(f)) 17)
(mytest (let* ((x '(1 2 (3 4))) (mytest (let* ((x '(1 2 (3 4)))
(f (f (match x ((_ _ (_ (get! get-it))) get-it))))
(match x (match x ((_ _ (_ (set! set-it))) (set-it 17)))
((_ _ (_ (get! get-it))) get-it)))) (f))
(match x 17)
((_ _ (_ (set! set-it))) (set-it 17)))
(f)) 17)
(mytest (let* ((x '(1 2 (3 4))) (mytest (let* ((x '(1 2 (3 4)))
(f (f (match x (((get! get-it) _ (_ _)) get-it))))
(match x (match x (((set! set-it) _ (_ _)) (set-it 17)))
(((get! get-it) _ (_ _)) get-it)))) (f))
(match x 17)
(((set! set-it) _ (_ _)) (set-it 17)))
(f)) 17)
(mytest (let* ((x '(1 2 (3 4))) (mytest (let* ((x '(1 2 (3 4)))
(f (f (match x ((_ (get! get-it) (_ _)) get-it))))
(match x (match x ((_ (set! set-it) (_ _)) (set-it 17)))
((_ (get! get-it) (_ _)) get-it)))) (f))
(match x 17)
((_ (set! set-it) (_ _)) (set-it 17)))
(f)) 17)
;get! for improper lists ;get! for improper lists
(mytest (let* ((x '(1 2 (3 . 4) . 5)) (mytest (let* ((x '(1 2 (3 . 4) . 5))
(f (f (match x (((get! get-it) _ (_ . _) . _) get-it))))
(match x (match x (((set! set-it) _ (_ . _) . _) (set-it 17)))
(((get! get-it) _ (_ . _) . _) get-it)))) (f))
(match x 17)
(((set! set-it) _ (_ . _) . _) (set-it 17)))
(f)) 17)
(mytest (let* ((x '(1 2 (3 . 4) . 5)) (mytest (let* ((x '(1 2 (3 . 4) . 5))
(f (f (match x ((_ (get! get-it) (_ . _) . _) get-it))))
(match x (match x ((_ (set! set-it) (_ . _) . _) (set-it 17)))
((_ (get! get-it) (_ . _) . _) get-it)))) (f))
(match x 17)
((_ (set! set-it) (_ . _) . _) (set-it 17)))
(f)) 17)
(mytest (let* ((x '(1 2 (3 . 4) . 5)) (mytest (let* ((x '(1 2 (3 . 4) . 5))
(f (f (match x ((_ _ ((get! get-it) . _) . _) get-it))))
(match x (match x ((_ _ ((set! set-it) . _) . _) (set-it 17)))
((_ _ ((get! get-it) . _) . _) get-it)))) (f))
(match x 17)
((_ _ ((set! set-it) . _) . _) (set-it 17)))
(f)) 17)
(mytest (let* ((x '(1 2 (3 . 4) . 5)) (mytest (let* ((x '(1 2 (3 . 4) . 5))
(f (f (match x ((_ _ (_ . (get! get-it)) . _) get-it))))
(match x (match x ((_ _ (_ . (set! set-it)) . _) (set-it 17)))
((_ _ (_ . (get! get-it)) . _) get-it)))) (f))
(match x 17)
((_ _ (_ . (set! set-it)) . _) (set-it 17)))
(f)) 17)
(mytest (let* ((x '(1 2 (3 . 4) . 5)) (mytest (let* ((x '(1 2 (3 . 4) . 5))
(f (f (match x ((_ _ (_ . _) . (get! get-it)) get-it))))
(match x (match x ((_ _ (_ . _) . (set! set-it)) (set-it 17)))
((_ _ (_ . _) . (get! get-it)) get-it)))) (f))
(match x 17)
((_ _ (_ . _) . (set! set-it)) (set-it 17)))
(f)) 17)
|# |#
;; get! for vectors ;; get! for vectors
(mytest (let* ((x (vector 1 2)) (mytest (let* ((x (vector 1 2))
(f (f (match x (#(_ (get! get-it)) get-it))))
(match x (match x (#(_ (set! set-it)) (set-it 17)))
(#(_ (get! get-it)) get-it)))) (f))
(match x 17)
(#(_ (set! set-it)) (set-it 17)))
(f)) 17)
(mytest (let* ((x (vector 1 2)) (mytest (let* ((x (vector 1 2))
(f (f (match x (#((get! get-it) _) get-it))))
(match x (match x (#((set! set-it) _) (set-it 17)))
(#((get! get-it) _) get-it)))) (f))
(match x 17)
(#((set! set-it) _) (set-it 17)))
(f)) 17)
;; get! for boxes ;; get! for boxes
(mytest (let* ((x (box 1)) (mytest (let* ((x (box 1))
(f (f (match x (#&(get! get-it) get-it))))
(match x (match x (#&(set! set-it) (set-it 17)))
(#&(get! get-it) get-it)))) (f))
(match x 17)
(#&(set! set-it) (set-it 17)))
(f)) 17)
#; #;
(mytest (let* ((x #&(1 2)) (mytest (let* ((x #&(1 2))
(f (f (match x (#&(_ (get! get-it)) get-it))))
(match x (match x (#&(_ (set! set-it)) (set-it 17)))
(#&(_ (get! get-it)) get-it)))) (f))
(match x 17)
(#&(_ (set! set-it)) (set-it 17)))
(f)) 17)
(mytest (let* ((x (box (vector 1 2))) (mytest (let* ((x (box (vector 1 2)))
(f (f (match x (#&#(_ (get! get-it)) get-it))))
(match x (match x (#&#(_ (set! set-it)) (set-it 17)))
(#&#(_ (get! get-it)) get-it)))) (f))
(match x 17)
(#&#(_ (set! set-it)) (set-it 17)))
(f)) 17)
|# |#
@ -441,167 +397,35 @@
(`#&(c a b ,@(a b c) r f i) (list a b c))) (`#&(c a b ,@(a b c) r f i) (list a b c)))
'(1 2 3)) '(1 2 3))
(mytest (match (list (mytest (match (list "hi" 1 'there #\c #t #f '(a b c) '(a b . c)
"hi" '(a b c c c c) #(a b c) #(a b c c c c) #&(a b c)
1 '(1 2 3) '(4 5 . 6) '(7 8 9) #(10 11 12) #&(13 14 15 16)
'there 1 2 3 4 17)
#\c (`("hi" 1 there #\c #t #f (a b c) (a b . c) (a b c ..2) #(a b c)
#t #(a b c ..2) #&(a b c) ,(a b c) ,(c1 d . e) ,(f g h ...)
#f ,#(i j k) ,#&(l m n o) ,@(1 2 3 4 p))
'(a b c) (list a b c c1 d e f g h i j k l m n o p)))
'(a b . c) '(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
'(a b c c c c)
#(a b c)
#(a b c c c c)
#&(a b c)
'(1 2 3)
'(4 5 . 6)
'(7 8 9)
#(10 11 12)
#&(13 14 15 16)
1
2
3
4
17
)
(`(
"hi"
1
there
#\c
#t
#f
(a b c)
(a b . c)
(a b c ..2)
#(a b c)
#(a b c ..2)
#&(a b c)
,(a b c)
,(c1 d . e)
,(f g h ...)
,#(i j k)
,#&(l m n o)
,@(1 2 3 4 p)
)
(list
a b c
c1 d e
f g h
i j k
l m n o
p
)))
'(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
(mytest (match (vector (mytest (match (vector "hi" 1 'there #\c #t #f '(a b c) '(a b . c)
"hi" '(a b c c c c) #(a b c) #(a b c c c c) #&(a b c)
1 '(1 2 3) '(4 5 . 6) '(7 8 9) #(10 11 12)
'there #&(13 14 15 16) 1 2 3 4 17)
#\c (`#("hi" 1 there #\c #t #f (a b c) (a b . c) (a b c ..2) #(a b c)
#t #(a b c ..2) #&(a b c) ,(a b c) ,(c1 d . e) ,(f g h ...)
#f ,#(i j k) ,#&(l m n o) ,@(1 2 3 4 p))
'(a b c) (list a b c c1 d e f g h i j k l m n o p)))
'(a b . c) '(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
'(a b c c c c)
#(a b c)
#(a b c c c c)
#&(a b c)
'(1 2 3)
'(4 5 . 6)
'(7 8 9)
#(10 11 12)
#&(13 14 15 16)
1
2
3
4
17
)
(`#(
"hi"
1
there
#\c
#t
#f
(a b c)
(a b . c)
(a b c ..2)
#(a b c)
#(a b c ..2)
#&(a b c)
,(a b c)
,(c1 d . e)
,(f g h ...)
,#(i j k)
,#&(l m n o)
,@(1 2 3 4 p)
)
(list
a b c
c1 d e
f g h
i j k
l m n o
p
)))
'(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
(mytest (match (box (list (mytest (match (box (list "hi" 1 'there #\c #t #f '(a b c) '(a b . c)
"hi" '(a b c c c c) #(a b c) #(a b c c c c) #&(a b c)
1 '(1 2 3) '(4 5 . 6) '(7 8 9) #(10 11 12)
'there #&(13 14 15 16) 1 2 3 4 17))
#\c (`#&("hi" 1 there #\c #t #f (a b c) (a b . c) (a b c ..2) #(a b c)
#t #(a b c ..2) #&(a b c) ,(a b c) ,(c1 d . e) ,(f g h ...)
#f ,#(i j k) ,#&(l m n o) ,@(1 2 3 4 p))
'(a b c) (list a b c c1 d e f g h i j k l m n o p)))
'(a b . c) '(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
'(a b c c c c)
#(a b c)
#(a b c c c c)
#&(a b c)
'(1 2 3)
'(4 5 . 6)
'(7 8 9)
#(10 11 12)
#&(13 14 15 16)
1
2
3
4
17
))
(`#&(
"hi"
1
there
#\c
#t
#f
(a b c)
(a b . c)
(a b c ..2)
#(a b c)
#(a b c ..2)
#&(a b c)
,(a b c)
,(c1 d . e)
,(f g h ...)
,#(i j k)
,#&(l m n o)
,@(1 2 3 4 p)
)
(list
a b c
c1 d e
f g h
i j k
l m n o
p
)))
'(1 2 3 4 5 6 7 8 (9) 10 11 12 13 14 15 16 17))
(mytest (match '(1 2 3 4) (mytest (match '(1 2 3 4)
(`(,@`(,x ,y) ,@`(,a ,b)) (list x y a b))) (`(,@`(,x ,y) ,@`(,a ,b)) (list x y a b)))
@ -629,7 +453,6 @@
((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8))))))) ((((1 2) (3 4)) ((5 6) (7 8))) (((1 2) (3 4)) ((5 6) (7 8)))))))
(mytest (match #(#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8)))) (mytest (match #(#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))
#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))) #(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8)))))
#(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8)))) #(#(#(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))) #(#(#(1 2) #(3 4)) #(#(5 6) #(7 8))))

View File

@ -11,13 +11,15 @@
(fprintf out "~a" txt)))) (fprintf out "~a" txt))))
(define (print-out msg B/sE) (define (print-out msg B/sE)
(displayln (list msg (displayln
(list msg
(exact->inexact B/sE) 'bytes-per-second (exact->inexact B/sE) 'bytes-per-second
(exact->inexact (/ B/sE (* 1024 1024))) 'MB-per-second))) (exact->inexact (/ B/sE (* 1024 1024)))
'MB-per-second)))
(define (processes-byte-message-test) (define (processes-byte-message-test)
(let ([pl (let ([pl (pp:place/base
(pp:place/base (bo ch) (bo ch)
(define message-size (* 4024 1024)) (define message-size (* 4024 1024))
(define count 10) (define count 10)
(define fourk-b-message (make-bytes message-size 66)) (define fourk-b-message (make-bytes message-size 66))
@ -29,7 +31,8 @@
(define four-k-message (make-bytes message-size 65)) (define four-k-message (make-bytes message-size 65))
(define count 10) (define count 10)
(define-values (r t1 t2 t3) (define-values (r t1 t2 t3)
(time-apply (lambda () (time-apply
(lambda ()
(for ([i (in-range count)]) (for ([i (in-range count)])
(pp:place-channel-put pl four-k-message) (pp:place-channel-put pl four-k-message)
(pp:place-channel-get pl))) null)) (pp:place-channel-get pl))) null))
@ -62,7 +65,8 @@ END
(define four-k-message (make-bytes message-size 65)) (define four-k-message (make-bytes message-size 65))
(define count 150) (define count 150)
(define-values (r t1 t2 t3) (define-values (r t1 t2 t3)
(time-apply (lambda () (time-apply
(lambda ()
(for ([i (in-range count)]) (for ([i (in-range count)])
(place-channel-put pl four-k-message) (place-channel-put pl four-k-message)
(place-channel-get pl))) null)) (place-channel-get pl))) null))
@ -87,13 +91,15 @@ END
"pct1.rkt") "pct1.rkt")
(let ([pl (dynamic-place "pct1.rkt" 'place-main)]) (let ([pl (dynamic-place "pct1.rkt" 'place-main)])
(define tree (let loop ([depth 8]) (define tree
(let loop ([depth 8])
(if (depth . <= . 0) (if (depth . <= . 0)
1 1
(cons (loop (sub1 depth)) (loop (sub1 depth)))))) (cons (loop (sub1 depth)) (loop (sub1 depth))))))
(define count 500) (define count 500)
(define-values (r t1 t2 t3) (define-values (r t1 t2 t3)
(time-apply (lambda () (time-apply
(lambda ()
(for ([i (in-range count)]) (for ([i (in-range count)])
(place-channel-put pl tree) (place-channel-put pl tree)
(place-channel-get pl))) null)) (place-channel-get pl))) null))

View File

@ -164,9 +164,12 @@
(syntax-case stx () (syntax-case stx ()
[(_ lst (name listvar) body ...) [(_ lst (name listvar) body ...)
#'(begin #'(begin
(define places (for/list ([i (in-range (processor-count))]) (define places
(for/list ([i (in-range (processor-count))])
(place/lambda (name ch) (place/lambda (name ch)
(place-channel-put ch ((lambda (listvar) body ...) (place-channel-get ch)))))) (place-channel-put ch
((lambda (listvar) body ...)
(place-channel-get ch))))))
(for ([p places] (for ([p places]
[item (split-n (processor-count) lst)]) [item (split-n (processor-count) lst)])

View File

@ -63,11 +63,8 @@
(define-syntax (time-n stx) (define-syntax (time-n stx)
(syntax-case stx () (syntax-case stx ()
[(_ msg cnt body ...) [(_ msg cnt body ...)
#'(let-values ([(r ct rt gct) (time-apply #'(let-values ([(r ct rt gct)
(lambda () (time-apply (lambda () body ...) null)])
body ...
)
null)])
(displayln (list msg cnt ct rt gct)) (displayln (list msg cnt ct rt gct))
(if (pair? r) (car r) r)) (if (pair? r) (car r) r))
#| #|

View File

@ -10,31 +10,28 @@
(check-equal? (matches-arity-exactly? (λ (x y) x) 2 3 '() '()) #f) (check-equal? (matches-arity-exactly? (λ (x y) x) 2 3 '() '()) #f)
(check-equal? (matches-arity-exactly? (λ (x y) x) 3 #f '() '()) #f) (check-equal? (matches-arity-exactly? (λ (x y) x) 3 #f '() '()) #f)
(check-equal? (matches-arity-exactly? (case-lambda (check-equal? (matches-arity-exactly? (case-lambda [() 1] [(x) 2])
[() 1] 0 1 '() '())
[(x) 2]) #t)
0 1 '() '()) #t) (check-equal? (matches-arity-exactly? (case-lambda [() 1] [(x) 2])
(check-equal? (matches-arity-exactly? (case-lambda 0 2 '() '())
[() 1] #f)
[(x) 2]) (check-equal? (matches-arity-exactly? (case-lambda [() 1] [(x y) 2])
0 2 '() '()) #f) 0 2 '() '())
(check-equal? (matches-arity-exactly? (case-lambda #f)
[() 1] (check-equal? (matches-arity-exactly? (case-lambda [() 1] [(x y) 2])
[(x y) 2]) 0 1 '() '())
0 2 '() '()) #f) #f)
(check-equal? (matches-arity-exactly? (case-lambda (check-equal? (matches-arity-exactly? (case-lambda [() 1] [(x y) 2])
[() 1] 0 #f '() '())
[(x y) 2]) #f)
0 1 '() '()) #f)
(check-equal? (matches-arity-exactly? (case-lambda
[() 1]
[(x y) 2])
0 #f '() '()) #f)
(check-equal? (matches-arity-exactly? (lambda (x . y) x) (check-equal? (matches-arity-exactly? (lambda (x . y) x)
1 #f '() '()) #t) 1 #f '() '())
#t)
(check-equal? (matches-arity-exactly? (lambda (x . y) x) (check-equal? (matches-arity-exactly? (lambda (x . y) x)
0 #f '() '()) #f) 0 #f '() '())
#f)
(check-equal? (matches-arity-exactly? (lambda (x #:y y) y) (check-equal? (matches-arity-exactly? (lambda (x #:y y) y)
1 1 '(#:y) '()) 1 1 '(#:y) '())
#t) #t)
@ -68,4 +65,3 @@
(check-equal? (matches-arity-exactly? (lambda (x #:y y #:z [z 1]) y) (check-equal? (matches-arity-exactly? (lambda (x #:y y #:z [z 1]) y)
1 1 '() '(#:y #:z)) 1 1 '() '(#:y #:z))
#f) #f)

View File

@ -64,7 +64,8 @@
(write-string "Hello\n" o) (write-string "Hello\n" o)
(close-output-port o) (close-output-port o)
(with-input-from-file "test1" (lambda () (with-input-from-file "test1"
(lambda ()
(check-equal? (port->string) "Hello\nBye\nHello\n" "output file contents match"))) (check-equal? (port->string) "Hello\nBye\nHello\n" "output file contents match")))
(define o2 (open-output-file "test1" #:exists 'replace)) (define o2 (open-output-file "test1" #:exists 'replace))
@ -76,7 +77,8 @@
(write-string "HELLO\n" o2) (write-string "HELLO\n" o2)
(close-output-port o2) (close-output-port o2)
(with-input-from-file "test1" (lambda () (with-input-from-file "test1"
(lambda ()
(check-equal? (port->string) "HELLO\nBYE\nHELLO\n" "output file contents match"))) (check-equal? (port->string) "HELLO\nBYE\nHELLO\n" "output file contents match")))
(define i2 (open-input-file "test2")) (define i2 (open-input-file "test2"))

View File

@ -59,7 +59,7 @@
;; * a `finished-stepping' is added if no error was specified ;; * a `finished-stepping' is added if no error was specified
;; * a `{...}' is replaced with `(hilite ...)' ;; * a `{...}' is replaced with `(hilite ...)'
(t 'mz1 m:mz (t 'mz1 m:mz
(for-each (lambda (x) x) '(1 2 3)) (for-each (lambda (x) x) '(1 2 3))
:: {(for-each (lambda (x) x) `(1 2 3))} -> (... {1} ...) :: {(for-each (lambda (x) x) `(1 2 3))} -> (... {1} ...)
:: ... -> (... {2} ...) :: ... -> (... {2} ...)

View File

@ -1,7 +1,7 @@
#lang typed-scheme #lang typed-scheme
(require/typed (require/typed
scheme/base scheme/base
[values (All (T) ((Any -> Boolean) -> (Any -> Boolean : T)))]) [values (All (T) ((Any -> Boolean) -> (Any -> Boolean : T)))])
(: number->string? (Any -> Boolean : (Number -> String))) (: number->string? (Any -> Boolean : (Number -> String)))
(define (number->string? x) (define (number->string? x)

View File

@ -8,6 +8,6 @@
(: make-empty-env (case-lambda [-> Environment] (: make-empty-env (case-lambda [-> Environment]
[Environment -> Environment])) [Environment -> Environment]))
(define make-empty-env (define make-empty-env
(case-lambda: [() (make-Environment #f (make-hasheq))] (case-lambda:
[((parent : Environment)) (make-Environment parent [() (make-Environment #f (make-hasheq))]
(make-hasheq))])) [((parent : Environment)) (make-Environment parent (make-hasheq))]))

View File

@ -22,7 +22,7 @@
(bytes-sort (bytes-sort
#"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<a href=\"#\">link</a>") #"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<a href=\"#\">link</a>")
(write-response (response/xexpr '(html))) (write-response (response/xexpr '(html)))
=> =>
(bytes-sort (bytes-sort
#"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<html></html>") #"HTTP/1.1 200 Okay\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<html></html>")

View File

@ -473,9 +473,8 @@
;thread-suspend-evt ;thread-suspend-evt
;Section 10.1.4 ;Section 10.1.4
[thread-send (-poly (a) [thread-send
(cl->* (-poly (a) (cl->* (-> -Thread Univ -Void)
(-> -Thread Univ -Void)
(-> -Thread Univ (-val #f) (-opt -Void)) (-> -Thread Univ (-val #f) (-opt -Void))
(-> -Thread Univ (-> a) (Un -Void a))))] (-> -Thread Univ (-> a) (Un -Void a))))]
[thread-receive (-> Univ)] [thread-receive (-> Univ)]
@ -552,7 +551,8 @@
[char-whitespace? (-> -Char B)] [char-whitespace? (-> -Char B)]
[char-blank? (-> -Char B)] [char-blank? (-> -Char B)]
[char-iso-control? (-> -Char B)] [char-iso-control? (-> -Char B)]
[char-general-category (-> -Char (apply Un (map -val [char-general-category
(-> -Char (apply Un (map -val
'(lu ll lt lm lo mn mc me nd nl no ps pe pi pf pd '(lu ll lt lm lo mn mc me nd nl no ps pe pi pf pd
pc po sc sm sk so zs zp zl cc cf cs co cn))))] pc po sc sm sk so zs zp zl cc cf cs co cn))))]
[make-known-char-range-list (-> (-lst (-Tuple (list -PosInt -PosInt B))))] [make-known-char-range-list (-> (-lst (-Tuple (list -PosInt -PosInt B))))]
@ -823,7 +823,8 @@
[build-path (cl->* [build-path
(cl->*
((list -Pathlike*) -Pathlike* . ->* . -Path) ((list -Pathlike*) -Pathlike* . ->* . -Path)
((list -SomeSystemPathlike*) -SomeSystemPathlike* . ->* . -SomeSystemPath))] ((list -SomeSystemPathlike*) -SomeSystemPathlike* . ->* . -SomeSystemPath))]
[build-path/convention-type [build-path/convention-type
@ -1661,8 +1662,7 @@
[process (-> -String [process (-> -String
(-values (list -Input-Port -Output-Port -Nat -Input-Port (-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->* (cl->* (-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte)) (-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv) (-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void) (-> (-val 'interrupt) -Void)
@ -1673,16 +1673,14 @@
(cl->* (cl->*
(->* (list -Pathlike) (Un -Path -String -Bytes) (->* (list -Pathlike) (Un -Path -String -Bytes)
(-values (list -Input-Port -Output-Port -Nat -Input-Port (-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->* (cl->* (-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte)) (-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv) (-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void) (-> (-val 'interrupt) -Void)
(-> (-val 'kill) -Void))))) (-> (-val 'kill) -Void)))))
(-> -Pathlike (-val 'exact) -String (-> -Pathlike (-val 'exact) -String
(-values (list -Input-Port -Output-Port -Nat -Input-Port (-values (list -Input-Port -Output-Port -Nat -Input-Port
(cl->* (cl->* (-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'status) (one-of/c 'running 'done-ok 'done-error))
(-> (-val 'exit-code) (-opt -Byte)) (-> (-val 'exit-code) (-opt -Byte))
(-> (-val 'wait) ManyUniv) (-> (-val 'wait) ManyUniv)
(-> (-val 'interrupt) -Void) (-> (-val 'interrupt) -Void)

View File

@ -49,7 +49,8 @@
(syntax-parse stx (syntax-parse stx
[(require/contract nm:renameable hidden:id cnt lib) [(require/contract nm:renameable hidden:id cnt lib)
#`(begin (require (only-in lib [nm.orig-nm nm.orig-nm-r])) #`(begin (require (only-in lib [nm.orig-nm nm.orig-nm-r]))
(define-syntax nm.nm (make-rename-transformer (define-syntax nm.nm
(make-rename-transformer
(syntax-property (syntax-property (quote-syntax hidden) (syntax-property (syntax-property (quote-syntax hidden)
'not-free-identifier=? #t) 'not-free-identifier=? #t)
'not-provide-all-defined #t))) 'not-provide-all-defined #t)))

View File

@ -9,8 +9,7 @@
(provide call ret with-monitor label (provide call ret with-monitor label
re->monitor-predicate/concurrent re->monitor-predicate/concurrent
re->monitor-predicate/serial re->monitor-predicate/serial
(all-from-out (all-from-out "monitor.rkt"
"monitor.rkt"
unstable/automata/re unstable/automata/re
unstable/automata/re-ext)) unstable/automata/re-ext))

View File

@ -7,7 +7,8 @@
racket/contract) racket/contract)
(provide/contract (provide/contract
[make-cookie ((cookie-name? cookie-value?) (#:comment (or/c false/c string?) [make-cookie ((cookie-name? cookie-value?)
(#:comment (or/c false/c string?)
#:domain (or/c false/c valid-domain?) #:domain (or/c false/c valid-domain?)
#:max-age (or/c false/c exact-nonnegative-integer?) #:max-age (or/c false/c exact-nonnegative-integer?)
#:path (or/c false/c string?) #:path (or/c false/c string?)