"pathname" |
First element is character other than #\< #\> #\|Treat entire string as a path name of file. If a file with the given name already exists on output procedure, the result is unspecified. |
"<pathname" |
First element is #\<Valid on input procedure. Treat susbstring starting from the second character as a path name of file. |
">pathname" |
First element is #\> and second is not #\>Valid on output procedure. Treat substring starting from the second character as a path name of file. If a file with the given name already exists, overwrite it. |
">>pathname" |
First element is #\> and second is #\>Valid on output procedure. Treat substring starting from the third character as a path name of file. If a file with the given name already exists, append to it. |
"|command" |
Frist element is #\|Treat substring starting from the second character as a command string. On input procedure, resulting port inputs from its standard output. On output procedure, resulting port outputs to its standard input. Exit status can be retrieved by rp:file-status (see below.) |
Because whether the string is for input or for output is determined by the
procedure it is supplied for, pipe symbol is always put on the head. Notice
that the syntax is different from that in perl in this point.
General
(gensym) procedure
(rp:symbol-value symbol [default-value]) procedure
symbol (in the toplevel environment.)
If symbol is unbound,
default-value is returned. If one is not
supplied, return value in that case is unspecified.
This is intended to be used to implement features such as property list
seen in other lisp dialects. Mixing the usage of symbol as a variable
on program and the usage of rp:symbol-value is discouraged.
(rp:symbol-value-set! symbol value) procedure
value of symbol
(in the toplevel environment.) See note on rp:symbol-value.
(rp:symbol-bound? symbol) procedure
#t if symbol is bound in the
toplevel environment, otherwise returns #f.
(eval expression) procedure
expression in toplevel environment.
(break [prompt]) procedure
Prompt is given
as string. If it is not supplied, defaults to "break> ".
(continue) procedure
continue is unbound if break loop is
not executing.
(rp:object->string object) procedure
object
as string.
(rp:string->object string) procedure
string.
(rp:eval-in-compiler-environment expression) syntax
(rp:load-into-compiler-environment file) syntax
(load file) on
interpreter. Put in toplevel, file will be loaded to the environment
of compiler when compiled. So the content of the file will affect the
compilation process insted of included in the output code.
(rp:use-macro-package file) syntax
file from several directories and load it
as in rp:load-into-compiler-environment. Search order is
-mpath option
RHIZOME_MACRO_PATH
RHIZOME_LIB
rp:*macro-search-list*, so search order is controlled by
assigning arbitrary value to this.
(exit [exit-code]) procedure
exit-code as status. Default of
exit-code is 0.
(system string) procedure
system() in the standard library and returns its
vaule.
(getenv string) procedure
string.
(file-exists? string) procedure
string exists,
#f otherwise.
*invocation-arg* global variable
(rp:command-line-arguments) procedure
(rp:time) procedure
#(real user sys).
(rp:errno) procedure
errno in the standard library.
(rp:strerror errono) procedure
strerror(errno) in
standard library.
(rp:catch-error procedure expression) syntax
procedure. The result must be a
procedure with two arguments. Next, evaluate
expression and return its vaule. If error is
caused in evaluating expression,
procedure is called in the form
(procedure error-code obj)and the vaule will be the value of entire form. The error processing environment consists a part of continuation.
(rp:call-with-error-handler error-proc thunk) procedure
(rp:catch-error procedure expression)
is implemented as a macro expanded to the following.
(rp:call-with-error-handler error-proc (lambda () expression))
(rp:error-message error-code obj) procedure
(rp:print-error-message error-code obj [port]) procedure
port
(default is current-output-port.)
(rp:exception (type arg ...) message-proc) syntax
(arg ...).
If this procedure gets called, exception of type
(type arg ...) is generated.
Type must be a symbol,
message-proc must be evaluated
(in the environment where (arg ...)
is bound to arguments) yielding an one argument procedure.
When error message of the exception is needed,
result of message-proc is called with an output
port as argument and it must generate appropriate message on that port.
(rp:displatch-exception error-code obj ((error-type arg ...) action ...) ...) syntax
Error-code and obj
are arguments of error
handling procedure obtained via rp:call-with-error-handler.
Clause with matching type is selected and its action is executed in the
environment where (arg ...) is bound to data of
exception. Result of last expression of action
will returned.(default error-code obj)
matches any type of error.(rp:os-error errno) |
function call results in error |
(rp:read-syntax-error message) |
syntax error in (read) |
(rp:eof-error) |
unexpected end of file |
(rp:storage-error) |
out of storage |
(rp:overflow-error) |
overflow of numerical calculation |
(rp:div0-error) |
divide by zero |
(rp:eval-error obj) |
illegal object is evaluated |
(rp:var-unbound-error var) |
variable is unbound |
(rp:apply-error obj) |
application of non-procedure |
(rp:arg-error) |
argument type missmatch |
(rp:primitive-error exp) |
wrong primitive syntax |
(rp:excess-formal-error) |
too many formal parameters |
(rp:arg-count-error) |
argument count missmatch |
(rp:define-error) |
define statement at illegal position |
(rp:exception-error data) |
exception generated via rp:exception |
(rp:map-error) |
arguments of map are not in same length |
(rp:eval-procedure-error) |
illegal behavior of evaluator procedure |
(rp:busy-port-error) |
procedure port is used while busy |
(rp:port-procedure-error) |
illegal behavior of port procedure |
rp:exception-error matches all exception
generated via rp:exception.
(rp:try-except expression ((error-type arg ...) action ...) ...) syntax
Expression is evaluated and its value will be
returned. If error is cuased while evaluation, it will be handled as in
rp:dispatch-exception.
(rp:raise-os-error errno) procedure
(rp:os-error errno).
(rp:set-signal-handler signal procedure) procedure
Signal is a signal numberd by system,
procedure is a procedure with one argument or
#t or #f. If signal
is raised, procedure is called as
(procedure signal)No particular restriction is imposed on the behavior of this
procedure. If procedure
is #t, the default action is restored. If
procedure is #f,
signal will be ignored. Vaule is the previous signal handler.
(rp:signal-message signal) procedure
(rp:print-signal-message signal [port]) procedure
port
(default is current-output-port.)
(rp:raise-signal signal) procedure
(rp:current-error-port) procedure
stderr.
(rp:set-current-input-port [port]) procedure
(rp:set-current-output-port [port]) procedure
current-input-port, current-output-port
respectively. If the argument is omitted, the original one at
invocation is restored.
(open-input-string string) procedure
string.
(open-output-string) procedure
(get-output-string port) procedure
Port must be a output port made by
rp:open-output-string. Retrieves string consisting of
characters outputted to the port so far.
(rp:open-input-procedure procs) procedure
Procs is a vector with four
elements, say
#(getchar ungetchar getlinecount char-readyp)Each element is a procedure. Doing a input from resulting port causes invocation of
getchar.
(getchar) => (char . procs')
procs' is a vector simillar to
procs (simillar in the following,) say
#(getchar' ungetchar' getlinecount' char-readyp')If
char is a character, it will be a charecter
read from the port. If char is a list of form
(error-code obj) where elements are
ones given as arguments of error handling procedure, input lasts with a
error of same type.
If char is #f, port is effectively
in a end-of-file status. In the next usage of port,
procs' will be used.Ungetchar gets called as
(ungetchar char) => procs'Here,
(getchar') => (char . procs''), procs == procs''
is expected.Getlinecount gets called as
(getlinecount) => (linecount . procs')
linecount is a integer, treated as a line
number when getlinecount is called. In particular, if it was 0, it means
the line number is not applicable.
Char-readyp gets called as
(char-readyp) => (ready? . procs')If
ready? is a Boolean value, it will be a
vaule of char-ready? of that port.
If it is a list of form (error-code obj),
error of that type is caused.
Note: In the duration of execution of these procedures, the port will be unusable. So, in particular, errors should not be generated. Errorneous conditions should be reported to the mechanism which calls the procedure via the interface above. The effect is unpreditable if an instance of invocation of these procedures returns multiple times.
(rp:open-output-procedure proc) procedure
Proc is a procedure.
Doing a output to resulting port causes invocation of
proc in the form
(proc char) => (result . proc')
Char is a character to be outputted.
If result is #t, the output is assumed to be done normally.
If result is a list of form (error-code obj),
error of that type will be generated.
In the next usage of port, proc' will be used.
The same note is applied as rp:open-output-procedure.
(rp:file-status port) procedure
Port must be a port result from
open-output-file or open-input-file.
The following vaules are returned accroding to the status of
port at closing time.
#f |
Port is not closed yet. |
| Generates a error | Underlying close operation (flose or pclose) returned -1. |
| Integer vaule | Return vaule other than -1 of underlying close operation (fclose of pclose.) |
(rp:apply-with-evaluator-hook hook-function procedure arguments)
(rp:hook-evaluator hook-function expression environment continuation)
(rp:call-evaluator expression environment)
(rp:top-level-environment)
(rp:expression->data expression environment)
(rp:hook-applicator hook-function procedure)
(rp:unhook-applicator procedure)