scribbling continuing

This commit is contained in:
Danny Yoo 2011-06-29 17:31:20 -04:00
parent f85a2d7a69
commit ded00097ee

View File

@ -5,7 +5,11 @@
scribble/eval scribble/eval
racket/sandbox racket/sandbox
(only-in racket/contract any/c) (only-in racket/contract any/c)
(for-label racket/base) ; (for-label racket/base)
(for-label (this-package-in lang/base))
(for-label (this-package-in js))
racket/runtime-path racket/runtime-path
"scribble-helpers.rkt" "scribble-helpers.rkt"
"../js-assembler/get-js-vm-implemented-primitives.rkt") "../js-assembler/get-js-vm-implemented-primitives.rkt")
@ -196,20 +200,20 @@ that accesses the JavaScript DOM. Call this file @filepath{dom-play.rkt}.
;; insert-break: -> void ;; insert-break: -> void
(define (insert-break) (define (insert-break)
(call ($ "<br/>") "appendTo" body) (call-method ($ "<br/>") "appendTo" body)
(void)) (void))
;; write-message: any -> void ;; write-message: any -> void
(define (write-message msg) (define (write-message msg)
(void (call (call (call ($ "<span/>") "text" msg) (void (call-method (call-method (call-method ($ "<span/>") "text" msg)
"css" "white-space" "pre") "css" "white-space" "pre")
"appendTo" "appendTo"
body))) body)))
;; Set the background green, and show some content ;; Set the background green, and show some content
;; on the browser. ;; on the browser.
(void (call body "css" "background-color" "lightgreen")) (void (call-method body "css" "background-color" "lightgreen"))
(void (call ($ "<h1>Hello World</h1>") "appendTo" body)) (void (call-method ($ "<h1>Hello World</h1>") "appendTo" body))
(write-message "Hello, this is a test!") (write-message "Hello, this is a test!")
(insert-break) (insert-break)
(let loop ([i 0]) (let loop ([i 0])
@ -274,21 +278,20 @@ commands to do something interesting...)
@section{The Whalesong language} @section{The Whalesong language}
@defmodule/this-package[lang/base]{ @defmodule/this-package[lang/base]
This needs to at least show all the bindings available from the base This needs to at least show all the bindings available from the base
language. language.
@defthing[true]{The boolean value @racket[#t]} @defthing[true boolean]{The boolean value @racket[#t].}
@defthing[false]{The boolean value @racket[#f]} @defthing[false boolean]{The boolean value @racket[#f].}
@defthing[pi]{The math constant @racket[pi].} @defthing[pi number]{The math constant @racket[pi].}
@defthing[e]{The math constant @racket[pi].} @defthing[e number]{The math constant @racket[pi].}
@defthing[null]{The empty list value @racket[null].} @defthing[null null]{The empty list value @racket[null].}
@defform[(let/cc id body ...)]{} @defform[(let/cc id body ...)]{}
@defform[(null? ...)]{} @defform[(null? ...)]{}
@defform[(not ...)]{} @defform[(not ...)]{}
@defform[(eq? ...)]{} @defform[(eq? ...)]{}
@ -297,9 +300,6 @@ language.
@subsection{IO} @subsection{IO}
@defform[(current-output-port ...)]{} @defform[(current-output-port ...)]{}
@defform[(current-print ...)]{} @defform[(current-print ...)]{}
@ -314,6 +314,7 @@ language.
@subsection{Numeric operations} @subsection{Numeric operations}
@defform[(+ ...)]{} @defform[(+ ...)]{}
@defform[(- ...)]{} @defform[(- ...)]{}
@defform[(* ...)]{} @defform[(* ...)]{}
@ -401,7 +402,6 @@ The bindings here might relocate!
@defform[(viewport-height)]{} @defform[(viewport-height)]{}
}