From 149d3a24cb149f01e024d184c27822550ab585c8 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 9 Dec 2008 21:57:50 +0000 Subject: [PATCH 1/6] handle symbol module path as extra path svn: r12757 --- collects/compiler/embed-unit.ss | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collects/compiler/embed-unit.ss b/collects/compiler/embed-unit.ss index cabba00a1f..3411da22db 100644 --- a/collects/compiler/embed-unit.ss +++ b/collects/compiler/embed-unit.ss @@ -326,6 +326,11 @@ (or (and (pair? a) (eq? 'lib (car a))) (symbol? a))) + + (define (symbol-to-lib-form l) + (if (symbol? l) + `(lib ,(symbol->string l)) + l)) (define (unix-style-split p) (let ([m (regexp-match #rx"^([^/]*)/(.*)$" p)]) @@ -423,7 +428,7 @@ (not (and (pair? x) (eq? 'quote (car x)))))) (apply append (map cdr importss)))] - [extra-paths (get-extra-imports filename code)]) + [extra-paths (map symbol-to-lib-form (get-extra-imports filename code))]) (let ([sub-files (map (lambda (i) (normalize (resolve-module-path-index i filename))) all-file-imports)] [sub-paths (map (lambda (i) (collapse-module-path-index i module-path)) From 56ffc62ee2a0fdd6076c7d514dd5c5048cca4ceb Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 9 Dec 2008 22:07:28 +0000 Subject: [PATCH 2/6] when embedding source modules for an executable, includes any needed reader modules svn: r12758 --- collects/lang/htdp-langs.ss | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/collects/lang/htdp-langs.ss b/collects/lang/htdp-langs.ss index 8b14895f7e..486d2f4218 100644 --- a/collects/lang/htdp-langs.ss +++ b/collects/lang/htdp-langs.ss @@ -439,18 +439,31 @@ (λ (port) (cond [(is-wxme-stream? port) - (let-values ([(snip-class-names data-class-names) - (extract-used-classes port)]) - (list* - '(lib "wxme/read.ss") - '(lib "mred/mred.ss") - reader-module - (filter - values - (map (λ (x) (string->lib-path x #t)) - (append - snip-class-names - data-class-names)))))] + (append + ;; Extract snip-related modules: + (let-values ([(snip-class-names data-class-names) + (extract-used-classes port)]) + (list* + '(lib "wxme/read.ss") + '(lib "mred/mred.ss") + reader-module + (filter + values + (map (λ (x) (string->lib-path x #t)) + (append + snip-class-names + data-class-names))))) + ;; Extract reader-related modules: + (begin + (file-position port 0) + (let ([mods null]) + (parameterize ([current-reader-guard + (let ([g (current-reader-guard)]) + (lambda (p) + (set! mods (cons p mods)) + (g p)))]) + (read-language (wxme-port->port port) (lambda () #f))) + mods)))] [else '()])))) #:mred? #t)))))) From 004759505b01c7e9444afd9c382421af05930109 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Wed, 10 Dec 2008 08:50:11 +0000 Subject: [PATCH 3/6] Welcome to a new PLT day. svn: r12761 --- collects/repos-time-stamp/stamp.ss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collects/repos-time-stamp/stamp.ss b/collects/repos-time-stamp/stamp.ss index d41205c7d1..03bdd9a5d8 100644 --- a/collects/repos-time-stamp/stamp.ss +++ b/collects/repos-time-stamp/stamp.ss @@ -1 +1 @@ -#lang scheme/base (provide stamp) (define stamp "9dec2008") +#lang scheme/base (provide stamp) (define stamp "10dec2008") From 247d9fb5fe8d3dd3020d74fe1a7cc16a7b1556ab Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Wed, 10 Dec 2008 16:37:18 +0000 Subject: [PATCH 4/6] Doc request svn: r12762 --- collects/web-server/scribblings/web.scrbl | 36 ++++++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/collects/web-server/scribblings/web.scrbl b/collects/web-server/scribblings/web.scrbl index d6509ffb52..bd7c65ad01 100644 --- a/collects/web-server/scribblings/web.scrbl +++ b/collects/web-server/scribblings/web.scrbl @@ -52,10 +52,18 @@ functions of interest for the servlet developer. @defproc[(send/suspend/dispatch [make-response (embed/url/c . -> . response?)]) any/c]{ - Calls @scheme[make-response] with a function that, when called with a procedure from + Calls @scheme[make-response] with a function (@scheme[embed/url]) that, when called with a procedure from @scheme[request?] to @scheme[any/c] will generate a URL, that when invoked will call the function with the @scheme[request?] object and return the result to the caller of - @scheme[send/suspend/dispatch]. + @scheme[send/suspend/dispatch]. Therefore, if you pass @scheme[embed/url] the identity function, + @scheme[send/suspend/dispatch] devolves into @scheme[send/suspend]: + + @schemeblock[ + (define (send/suspend response-generator) + (send/suspend/dispatch + (lambda (embed/url) + (response-generator (embed/url (lambda (x) x)))))) + ] Use @scheme[send/suspend/dispatch] when there are multiple `logical' continuations of a page. For example, we could either add to a number or subtract from it: @@ -79,8 +87,28 @@ functions of interest for the servlet developer. (add1 i)))]) "+")))))))) ] - It is very common that the return value of @scheme[send/suspend/dispatch] is irrevelant in - your application and you may think of it as ``embedding'' value-less callbacks. + Notice that in this example the result of the handlers are returned to the continuation of @scheme[send/suspend/dispatch]. + However, it is very common that the return value of @scheme[send/suspend/dispatch] is irrevelant in + your application and you may think of it as ``embedding'' value-less callbacks. Here is the same example in this style: + @schemeblock[ + (define (count-dot-com i) + (send/suspend/dispatch + (lambda (embed/url) + `(html + (head (title "Count!")) + (body + (h2 (a ([href + ,(embed/url + (lambda (req) + (count-dot-com (sub1 i))))]) + "-")) + (h1 ,(number->string i)) + (h2 (a ([href + ,(embed/url + (lambda (req) + (count-dot-com (add1 i))))]) + "+"))))))) + ] } @defproc[(send/forward [make-response response-generator/c] From 02147ef4f387018ee645f3642ec79758b0a974d3 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Wed, 10 Dec 2008 17:22:43 +0000 Subject: [PATCH 5/6] Fixing regression svn: r12764 --- collects/web-server/private/launch.ss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collects/web-server/private/launch.ss b/collects/web-server/private/launch.ss index 6884af754f..9d747ac966 100644 --- a/collects/web-server/private/launch.ss +++ b/collects/web-server/private/launch.ss @@ -61,7 +61,7 @@ (lambda (flags) (configuration-table->web-config@ (extract-flag 'config flags default-configuration-table-path) - #:port (or (port) 80) + #:port (port) #:listen-ip (extract-flag 'ip-address flags #f))) '())) From 965cbb00e20d53949c15281ea2b42c56309a2c73 Mon Sep 17 00:00:00 2001 From: John Clements Date: Wed, 10 Dec 2008 19:00:29 +0000 Subject: [PATCH 6/6] fixed test/exn svn: r12767 --- collects/handin-server/checker.ss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/collects/handin-server/checker.ss b/collects/handin-server/checker.ss index 8d5d1fc9f2..ed589110e2 100644 --- a/collects/handin-server/checker.ss +++ b/collects/handin-server/checker.ss @@ -726,8 +726,10 @@ (define-syntax (!test/exn stx) (syntax-case stx () [(_ test-exp) - #`(with-handlers ([exn:fail? (lambda (exn) #t)]) - ((submission-eval) `test-exp) + #`(unless + (with-handlers ([exn:fail? (lambda (exn) #t)]) + ((submission-eval) `test-exp) + #f) (error* "expected exception on test expression: ~v" (->disp 'test-exp)))]))