fixed some bugs allowing executables to be created

svn: r1510
This commit is contained in:
Robby Findler 2005-12-03 04:38:32 +00:00
parent f70f6c2332
commit ec2b43ad86
4 changed files with 10 additions and 11 deletions

View File

@ -55,6 +55,7 @@
"Philippe Meunier, "
"Jens Axel Søgaard, "
"Francisco Solsona, "
"Michael Sperber, "
"Reini Urban, "
"and "
"Paolo Zoppetti "

View File

@ -826,7 +826,7 @@
init-code
gui?
use-copy?)
(with-handlers ([(λ (x) #f) ;exn:fail?
(λ (x)
(message-box

View File

@ -970,7 +970,7 @@
".")
(drscheme:language:put-executable
((is-a?/c top-level-window<%>) string? boolean? boolean? string? . -> . (union false/c string?))
((is-a?/c top-level-window<%>) path? boolean? boolean? string? . -> . (union false/c path?))
(parent program-filename mred? launcher? title)
"Calls the MrEd primitive"
"@flink put-file"
@ -1017,7 +1017,8 @@
"otherwise it will indicate the user's choice.")
(drscheme:language:create-module-based-stand-alone-executable
(string? string? any/c any/c any/c boolean? boolean?
((union path? string?)
(union path? string?) any/c any/c any/c boolean? boolean?
. -> .
void?)
(program-filename
@ -1054,7 +1055,7 @@
"\\rawscm{namespace-require}. ")
(drscheme:language:create-module-based-launcher
(string? string? any/c any/c any/c boolean? boolean?
((union path? string?) (union path? string?) any/c any/c any/c boolean? boolean?
. -> .
void?)
(program-filename
@ -1305,7 +1306,7 @@
(case-> (any/c . -> . void?) (-> any/c))))
(create-executable (any/c
(union (is-a?/c dialog%) (is-a?/c frame%))
string?
path?
drscheme:teachpack:teachpack-cache?
. -> .
void?))

View File

@ -20,6 +20,7 @@ tracing todo:
(lib "class.ss")
(lib "list.ss")
(lib "file.ss")
(lib "port.ss")
(lib "tool.ss" "drscheme")
(lib "mred.ss" "mred")
(lib "bday.ss" "framework" "private")
@ -309,7 +310,7 @@ tracing todo:
(when executable-filename
(let ([wrapper-filename (make-temporary-file "drs-htdp-lang-executable~a.ss")]
[teachpack-specs
(map (lambda (x) `(file ,x))
(map (lambda (x) `(file ,(path->string x)))
(drscheme:teachpack:teachpack-cache-filenames teachpack-cache))])
(call-with-output-file wrapper-filename
(lambda (outp)
@ -327,11 +328,7 @@ tracing todo:
(fprintf outp "(module #%htdp-lang-executable #%htdp-lang-language\n")
(call-with-input-file program-filename
(lambda (inp)
(let loop ()
(let ([c (read-char inp)])
(unless (eof-object? c)
(display c outp)
(loop))))))
(copy-port inp outp)))
(fprintf outp "\n)\n\n")
(write `(require #%htdp-lang-executable) outp)
(newline outp))