4 Die Macht der Abstraktion fortgeschritten
This is documentation for the language level Die Macht der Abstraktion - fortgeschritten that goes with the German textbook Die Macht der Abstraktion.
program | = | def-or-expr ... | ||
def-or-expr | = | definition | ||
| | expr | |||
| | test-case | |||
definition | = | (define id expr) | ||
| | (define-record-procedures id id id (id ...)) | |||
| | (define-record-procedures-parametric (id id ...) id id (id ...)) | |||
| | (: id sig) | |||
| | (define-record-procedures-2 id id id (field-spec ...)) | |||
| | (define-record-procedures-parametric-2 id id id id (field-spec ...)) | |||
field-spec | = | id | ||
| | (id id) | |||
quoted | = | id | ||
| | number | |||
| | string | |||
| | character | |||
| | (quoted ...) | |||
| | ’quoted | |||
expr | = | (expr expr ...) ; Prozedurapplikation | ||
| | #t | |||
| | #f | |||
| | number | |||
| | string | |||
| | (lambda (id ...) expr) | |||
| | id ; Bezeichner | |||
| | (cond (expr expr) (expr expr) ...) | |||
| | (cond (expr expr) ... (else expr)) | |||
| | (if expr expr) | |||
| | (and expr ...) | |||
| | (or expr ...) | |||
| | (let ((id expr) ...) expr) | |||
| | (letrec ((id expr) ...) expr) | |||
| | (let* ((id expr) ...) expr) | |||
| | (begin expr expr ...) | |||
| | (signature sig) | |||
| | (for-all ((id sig) ...) expr) | |||
| | (==> expr expr) | |||
| | (set! id expr) | |||
| | ’quoted ; Quote-Literal | |||
sig | = | id | ||
| | (predicate expr) | |||
| | (one-of expr ...) | |||
| | (mixed sig ...) | |||
| | (sig ... -> sig) ; Prozedur-Signatur | |||
| | (list sig) | |||
| | %a %b %c ; Signatur-Variable | |||
| | (combined sig ...) | |||
| | signature | |||
test-case | = | (check-expect expr expr) | ||
| | (check-within expr expr expr) | |||
| | (check-member-of expr expr ...) | |||
| | (check-range expr expr expr) | |||
| | (check-error expr expr) | |||
| | (check-property expr) |
Zahlen |
* : (number number number ... -> number) |
+ : (number number number ... -> number) |
- : (number number ... -> number) |
/ : (number number number ... -> number) |
< : (real real real ... -> boolean) |
<= : (real real real ... -> boolean) |
= : (number number number ... -> boolean) |
> : (real real real ... -> boolean) |
>= : (real real real ... -> boolean) |
abs : (real -> real) |
acos : (number -> number) |
angle : (number -> real) |
asin : (number -> number) |
atan : (number -> number) |
ceiling : (real -> integer) |
complex? : (any -> boolean) |
cos : (number -> number) |
current-seconds : (-> natural) |
denominator : (rational -> natural) |
even? : (integer -> boolean) |
exact->inexact : (number -> number) |
exact? : (number -> boolean) |
exp : (number -> number) |
expt : (number number -> number) |
floor : (real -> integer) |
gcd : (integer integer ... -> natural) |
imag-part : (number -> real) |
inexact->exact : (number -> number) |
inexact? : (number -> boolean) |
integer? : (any -> boolean) |
lcm : (integer integer ... -> natural) |
log : (number -> number) |
magnitude : (number -> real) |
make-polar : (real real -> number) |
max : (real real ... -> real) |
min : (real real ... -> real) |
modulo : (integer integer -> integer) |
natural? : (any -> boolean) |
negative? : (number -> boolean) |
number->string : (number -> string) |
number? : (any -> boolean) |
numerator : (rational -> integer) |
odd? : (integer -> boolean) |
positive? : (number -> boolean) |
quotient : (integer integer -> integer) |
random : (natural -> natural) |
rational? : (any -> boolean) |
real-part : (number -> real) |
real? : (any -> boolean) |
remainder : (integer integer -> integer) |
round : (real -> integer) |
sin : (number -> number) |
sqrt : (number -> number) |
string->number : (string -> (mixed number false)) |
tan : (number -> number) |
zero? : (number -> boolean) |
boolesche Werte |
boolean=? : (boolean boolean -> boolean) |
boolean? : (any -> boolean) |
false? : (any -> boolean) |
not : (boolean -> boolean) |
true? : (any -> boolean) |
Listen |
append : ((list-of %a) ... -> (list-of %a)) |
cons : (%a (list-of %a) -> (list-of %a)) |
cons? : (any -> boolean) |
empty : list |
empty? : (any -> boolean) |
first : ((list-of %a) -> %a) |
fold : (%b (%a %b -> %b) (list-of %a) -> %b) |
length : ((list-of %a) -> natural) |
list : (%a ... -> (list-of %a)) |
list-ref : ((list-of %a) natural -> %a) |
make-pair : (%a (list-of %a) -> (list-of %a)) |
pair? : (any -> boolean) |
rest : ((list-of %a) -> (list-of %a)) |
reverse : ((list-of %a) -> (list-of %a)) |
Computer |
computer : signature |
computer-hard-drive : (computer -> rational) |
computer-processor : (computer -> string) |
computer-ram : (computer -> rational) |
computer? : (any -> boolean) |
make-computer : (string rational rational -> computer) |
Schokokekse |
chocolate-cookie : signature |
chocolate-cookie-chocolate : (chocolate-cookie -> number) |
chocolate-cookie-cookie : (chocolate-cookie -> number) |
chocolate-cookie? : (any -> boolean) |
make-chocolate-cookie : (number number -> chocolate-cookie) |
Zeichenketten |
string->strings-list : (string -> (list string)) |
string-append : (string string ... -> string) |
string-length : (string -> natural) |
string<=? : (string string string ... -> boolean) |
string<? : (string string string ... -> boolean) |
string=? : (string string string ... -> boolean) |
string>=? : (string string string ... -> boolean) |
string>? : (string string string ... -> boolean) |
string? : (any -> boolean) |
strings-list->string : ((list string) -> string) |
Symbole |
string->symbol : (string -> symbol) |
symbol->string : (symbol -> string) |
symbol? : (any -> boolean) |
Verschiedenes |
apply : (procedure (list %a) -> %b) |
eq? : (%a %b -> boolean) |
equal? : (%a %b -> boolean) |
for-each : ((%a -> %b) (list %a) -> unspecific) |
map : ((%a -> %b) (list %a) -> (list %b)) |
read : (-> any) |
violation : (string -> unspecific) |
write-newline : (-> unspecific) |
write-string : (string -> unspecific) |