Removing DrScheme tool and rearranging docs
svn: r18115
This commit is contained in:
parent
445ec5c145
commit
a627c56fb5
|
@ -1,21 +1,7 @@
|
|||
#lang setup/infotab
|
||||
(require string-constants)
|
||||
|
||||
(define blurb '("Language levels for the Programming Languages: Application and Interpretation textbook"))
|
||||
(define homepage "http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/")
|
||||
(define primary-file "main.ss")
|
||||
|
||||
(define scribblings '(("scribblings/plai.scrbl" () (language -11))))
|
||||
|
||||
(define textbook-pls
|
||||
(list (list '("plai-small.gif" "plai")
|
||||
"Programming Languages: Application and Interpretation"
|
||||
(string-constant teaching-languages)
|
||||
"Programming Languages: Application and Interpretation")))
|
||||
|
||||
(define tools (list "plai-tool.ss"))
|
||||
(define tool-icons (list "plai-small.gif"))
|
||||
(define tool-names
|
||||
(list "Programming Languages: Application and Interpretation"))
|
||||
(define tool-urls
|
||||
(list "http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/"))
|
||||
(define scribblings '(("scribblings/plai.scrbl" (multi-page) (language -11))))
|
||||
|
|
|
@ -1,129 +0,0 @@
|
|||
; Plenty of code borrowed from the HtDP languages.
|
||||
#lang scheme
|
||||
(require drscheme/tool
|
||||
framework/preferences
|
||||
plai/private/tool-private
|
||||
string-constants)
|
||||
|
||||
(provide tool@)
|
||||
|
||||
(define tool@
|
||||
(unit
|
||||
(import drscheme:tool^)
|
||||
(export drscheme:tool-exports^)
|
||||
|
||||
(define (language-extension %)
|
||||
(class %
|
||||
(inherit get-reader get-module)
|
||||
(inherit-field reader-module module)
|
||||
|
||||
(define/override (get-reader-module) reader-module)
|
||||
|
||||
(define/override (front-end/complete-program port settings)
|
||||
(plai-complete-program port settings (get-reader) (get-module)))
|
||||
|
||||
; drscheme/private/auto-language.ss insists on #reader
|
||||
; "#lang plai\n"
|
||||
(define/override (get-metadata modname settings)
|
||||
(string-append
|
||||
";; The first three lines of this file were inserted by DrScheme. They record metadata\n"
|
||||
";; about the language level of this file in a form that our tools can easily process.\n"
|
||||
(format "#reader~s~n" reader-module)))
|
||||
|
||||
;; Change print style in default settings from 'write to 'constructor:
|
||||
(define/override (default-settings)
|
||||
(let ([s (super default-settings)])
|
||||
(drscheme:language:make-simple-settings
|
||||
(drscheme:language:simple-settings-case-sensitive s)
|
||||
'constructor
|
||||
(drscheme:language:simple-settings-fraction-style s)
|
||||
(drscheme:language:simple-settings-show-sharing s)
|
||||
(drscheme:language:simple-settings-insert-newlines s)
|
||||
'test-coverage)))
|
||||
|
||||
(define/override (metadata->settings metadata)
|
||||
(default-settings))
|
||||
|
||||
(define/override (get-metadata-lines) 3)
|
||||
|
||||
(super-new)))
|
||||
|
||||
|
||||
;; module-based-language-extension : (implements drscheme:language:module-based-language<%>)
|
||||
;; -> (implements drscheme:language:module-based-language<%>)
|
||||
;; changes the default settings and sets a few more paramters during `on-execute'
|
||||
(define (module-based-language-extension super%)
|
||||
(class* super% ()
|
||||
|
||||
(init-field reader-module)
|
||||
(define/override (default-settings)
|
||||
(super default-settings))
|
||||
|
||||
(define/override (marshall-settings x)
|
||||
(super marshall-settings x))
|
||||
|
||||
(define/override (unmarshall-settings x)
|
||||
(super unmarshall-settings x))
|
||||
|
||||
(super-new)))
|
||||
|
||||
; Returns #t if PLAI is being run for the first time and #f otherwise.
|
||||
; This is determined by the value of the plai:first-run field. If the
|
||||
; field is not present, assume #t.
|
||||
(define (is-first-run?)
|
||||
(preferences:set-default 'plai:first-run #t boolean?)
|
||||
(preferences:get 'plai:first-run))
|
||||
|
||||
; Add type-case to lambda-like keywords, only if (is-first-run?) => #t. PLT Scheme 4.0 adds ^def as a
|
||||
; regexp for define-like keywords. Hence, we no longer have a clause here for define-type.
|
||||
(define (setup-indentation!)
|
||||
(when (is-first-run?)
|
||||
(preferences:set 'plai:first-run #f)
|
||||
(let ([indentation-ht (first (preferences:get 'framework:tabify))])
|
||||
(hash-set! indentation-ht 'type-case 'lambda)
|
||||
#;(hash-set! indentation-ht 'define-type 'define))))
|
||||
|
||||
(define (phase1) (void))
|
||||
|
||||
;; phase2 : -> void
|
||||
(define (phase2)
|
||||
(local ([define plai-language%
|
||||
((drscheme:language:get-default-mixin)
|
||||
(language-extension
|
||||
(drscheme:language:module-based-language->language-mixin
|
||||
(module-based-language-extension
|
||||
(drscheme:language:simple-module-based-language->module-based-language-mixin
|
||||
drscheme:language:simple-module-based-language%)))))]
|
||||
|
||||
[define next-language-number (box 1)]
|
||||
|
||||
[define (add-plai-language #:summary summary #:module module #:title title #:reader reader-module)
|
||||
(drscheme:language-configuration:add-language
|
||||
(instantiate plai-language% ()
|
||||
(one-line-summary summary)
|
||||
(module module)
|
||||
(reader-module reader-module)
|
||||
(language-position (list (string-constant teaching-languages)
|
||||
"Programming Languages: Application and Interpretation"
|
||||
title))
|
||||
(language-numbers `(-500 -400 ,(unbox next-language-number)))))
|
||||
(set-box! next-language-number (add1 (unbox next-language-number)))])
|
||||
|
||||
(add-plai-language #:summary "Scheme with datatypes"
|
||||
#:module `plai
|
||||
#:reader `plai/lang/reader
|
||||
#:title "PLAI Scheme")
|
||||
(add-plai-language #:summary "language for writing garbage collectors"
|
||||
#:module `plai/collector
|
||||
#:reader `plai/collector/lang/reader
|
||||
#:title "GC Collector Scheme")
|
||||
(add-plai-language #:summary "language for testing garbage collectors"
|
||||
#:module `plai/mutator
|
||||
#:reader `plai/mutator/lang/reader
|
||||
#:title "GC Mutator Scheme")
|
||||
(add-plai-language #:summary "language for writing web applications"
|
||||
#:module `plai/web
|
||||
#:reader `plai/web/lang/reader
|
||||
#:title "Web Application")
|
||||
(setup-indentation!)))
|
||||
))
|
|
@ -1,34 +0,0 @@
|
|||
#lang scheme
|
||||
|
||||
(provide plai-complete-program)
|
||||
(define (plai-complete-program port settings reader language-module)
|
||||
(let ([state 'init])
|
||||
;; state : 'init => 'require => 'done
|
||||
(lambda ()
|
||||
(case state
|
||||
[(init)
|
||||
(set! state 'require)
|
||||
(let ([body-exps
|
||||
(let loop ()
|
||||
(let ([result (reader (object-name port) port)])
|
||||
(if (eof-object? result)
|
||||
null
|
||||
(cons result (loop)))))])
|
||||
(expand
|
||||
(datum->syntax
|
||||
#f
|
||||
`(,#'module #%plai ,language-module
|
||||
,@body-exps))))]
|
||||
[(require)
|
||||
(set! state 'done)
|
||||
(syntax
|
||||
(let ([done-already? #f])
|
||||
(dynamic-wind
|
||||
void
|
||||
(lambda ()
|
||||
(dynamic-require ''#%plai #f))
|
||||
(lambda ()
|
||||
(unless done-already?
|
||||
(set! done-already? #t)
|
||||
(current-namespace (module->namespace ''#%plai)))))))]
|
||||
[(done) eof]))))
|
|
@ -50,15 +50,9 @@ Interpretation} (PLAI). The full book can be found on the Web at:
|
|||
@(link "http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/"
|
||||
"http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/")
|
||||
|
||||
In DrScheme, under the @onscreen{Language} menu, select @onscreen{Choose Language...}. Under the section @onscreen{Programming
|
||||
Languages: Application and Interpretation}, you will find the following languages:
|
||||
This package contains the following languages:
|
||||
|
||||
@itemize{
|
||||
@item{@secref["plai-scheme"] - @schememodlang[plai]}
|
||||
@item{@secref["collector"] - @schememodlang[plai/collector]}
|
||||
@item{@secref["mutator"] - @schememodlang[plai/mutator]}
|
||||
@item{@secref["web"] - @schememodlang[plai/web]}
|
||||
}
|
||||
@local-table-of-contents[#:style 'immediate-only]
|
||||
|
||||
@section[#:tag "plai-scheme"]{@PLAI-LANG}
|
||||
|
||||
|
@ -486,38 +480,8 @@ In @|MUTATE-LANG|, @scheme[printf] is a syntactic form and not a procedure. The
|
|||
@scheme[_format] is not allocated on the mutator's heap.
|
||||
|
||||
}
|
||||
|
||||
@section[#:tag "web"]{@WEB-LANG}
|
||||
|
||||
@defmodulelang[plai/web]
|
||||
|
||||
The @WEB-LANG language allows you to write server-side Web applications for the PLT Web Server.
|
||||
|
||||
For more information about writing Web applications, see:
|
||||
@other-manual['(lib "web-server/scribblings/web-server.scrbl")].
|
||||
|
||||
When you click on the @onscreen{Run} button in DrScheme, your Web application is launched in the Web server.
|
||||
|
||||
The application is available at @italic{http://localhost:8000/servlets/standalone.ss}.
|
||||
|
||||
The @WEB-LANG language will automatically load this URL in your Web browser.
|
||||
|
||||
You may use @scheme[no-web-browser] to prevent the browser from being launched and @scheme[static-files-path]
|
||||
to serve additional static files.
|
||||
|
||||
@subsection{Web Application Exports}
|
||||
|
||||
@declare-exporting[#:use-sources (plai/scribblings/fake-web)]
|
||||
|
||||
A Web application must define a procedure @scheme[start]:
|
||||
|
||||
@defproc[(start (initial-request request?)) response?]{
|
||||
|
||||
The initial request to a Web application is serviced by this procedure.
|
||||
|
||||
}
|
||||
|
||||
@section{Generating Random Mutators}
|
||||
|
||||
@subsection{Generating Random Mutators}
|
||||
|
||||
@defmodule[plai/random-mutator]
|
||||
|
||||
|
@ -582,3 +546,33 @@ of random mutators:
|
|||
PLAI program. If @scheme[input] is a file, the contents of the file are
|
||||
used.
|
||||
}
|
||||
|
||||
@section[#:tag "web"]{@WEB-LANG}
|
||||
|
||||
@defmodulelang[plai/web]
|
||||
|
||||
The @WEB-LANG language allows you to write server-side Web applications for the PLT Web Server.
|
||||
|
||||
For more information about writing Web applications, see:
|
||||
@other-manual['(lib "web-server/scribblings/web-server.scrbl")].
|
||||
|
||||
When you click on the @onscreen{Run} button in DrScheme, your Web application is launched in the Web server.
|
||||
|
||||
The application is available at @italic{http://localhost:8000/servlets/standalone.ss}.
|
||||
|
||||
The @WEB-LANG language will automatically load this URL in your Web browser.
|
||||
|
||||
You may use @scheme[no-web-browser] to prevent the browser from being launched and @scheme[static-files-path]
|
||||
to serve additional static files.
|
||||
|
||||
@subsection{Web Application Exports}
|
||||
|
||||
@declare-exporting[#:use-sources (plai/scribblings/fake-web)]
|
||||
|
||||
A Web application must define a procedure @scheme[start]:
|
||||
|
||||
@defproc[(start (initial-request request?)) response?]{
|
||||
|
||||
The initial request to a Web application is serviced by this procedure.
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user