A string containing the home directory of the user.
Returns a nonempty list of immutable strings. The first element is an implementation-specific name for the running top-level program. The remaining elements are the command-line arguments, as passed to the
mainmethod (except for those flags processed by Kawa itself).
The first element will depend on how the Kawa module was invoked. Kawa uses the following rules to determine the command name:
If the property
kawa.command.nameis set, that is used. This variable can be set on the
kawacommand line, for example from a script:kawa -Dkawa.command.name="$0" foo "$@"
This variable is also set implicitly by the meta-arg option. FIXME.
If we’re reading a source file that starts with the Unix command-file prefix ‘
#!/’ then we use the name of the source file. The assumption is that such a file is an executable script.
If the Java property
kawa.command.lineis set, then we use that (after stripping off text that duplicates the remaining arguments). The
kawaprogram sets this property to the command line used to invoke it (specifically the contents of the entire
argvarray), before invoking the
If the Java property
sun.java.commandis set, then we use that (after stripping off text that duplicates the remaining arguments), and then prepending the string
"java ". The OpenJDK
javaprogram sets this property.
If all else fails, the command name is
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.
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.
value$ java kawa.repl -- abc=123 def #|kawa:1|# (write (command-line)) ("java kawa.repl --" "abc=123" "def") #|kawa:2|# (process-command-line-assignments) #|kawa:3|# (write (command-line)) ("java kawa.repl -- abc=123" "def") #|kawa:4|# abc 123
This function is mostly useful for Kawa applications compiled with the
--mainoption. (It is used to set XQuery
Many operating systems provide each running process with an environment conisting of environment variables. (This environment is not to be confused with the Scheme environments that can be passed to
eval.) Both the name and value of an environment variable are strings. The procedure
get-environment-variablereturns the value of the environment variable
#fif the environment variable is not found. (This uses the
java.lang.System:getenvmethod.) It is an error to mutate the resulting string.(get-environment-variable "PATH") ⇒ "/usr/local/bin:/usr/bin:/bin"
Returns the names and values of all the environment variables as an alist, where the car of each entry is the name of an environment variable, and the cdr is its value, both as strings. It is an error to mutate any of the strings or the alist itself.(get-environment-variables) ⇒ (("USER" . "root") ("HOME" . "/"))