A string containing the home directory of the user.
Returns a nonempty list of strings. The first element is an implementation-specific name for the running top-level program. (For now this is just
"kawa", but it may become something more useful in the future.) The remaining elements are the command-line arguments, as passed to themainmethod.
Variable: command-line-arguments
Any command-line arguments (following flags processed by Kawa itself) are assigned to the global variable ‘
command-line-arguments’, which is a vector of strings.
Procedure: process-command-line-assignments
Process any initial command-line options that set variables. These have the form
. Any such command-line options (at the start of the command-line) are processed and removed from the command-line.name=value$ kawa -- abc=123 def #|kawa:1|# (command-line) (kawa abc=123 def) #|kawa:2|# (process-command-line-assignments) #|kawa:3|# (command-line) (kawa def) #|kawa:4|# abc 123This function is mostly useful for Kawa applications compiled with the
--mainoption. (It is used to set XQueryexternalvariables.)
Exits the Kawa interpreter, and ends the Java session. The integer value
codeis returned to the operating system. Ifcodeis not specified, zero is returned, indicating normal (non-error) termination. If thecodeis#f, it is treated as -1, which means an abnormal exit.
Procedure: make-process command envp
Creates a
<java.lang.Process>object, using the specifiedcommandandenvp. Thecommandis converted to an array of Java strings (that is an object that has type<java.lang.String[]>. It can be a Scheme vector or list (whose elements should be Java strings or Scheme strings); a Java array of Java strings; or a Scheme string. In the latter case, the command is converted usingcommand-parse. Theenvpis process environment; it should be either a Java array of Java strings, or the special#!nullvalue.
Runs the specified
command, and waits for it to finish. Returns the return code from the command. The return code is an integer, where 0 conventionally means successful completion. Thecommandcan be any of the types handled bymake-process.
The value of this variable should be a one-argument procedure. It is used to convert a command from a Scheme string to a Java array of the constituent "words". The default binding, on Unix-like systems, returns a new command to invoke
"/bin/sh" "-c"concatenated with the command string; on non-Unix-systems, it is bound totokenize-string-to-string-array.
Procedure: tokenize-string-to-string-array command
Uses a
java.util.StringTokenizerto parse thecommandstring into an array of words. This splits thecommandusing spaces to delimit words; there is no special processing for quotes or other special characters. (This is the same as whatjava.lang.Runtime.exec(String)does.)