Module System contains some useful features for interacting with the host environment.
SOURCE NOTE: most of these come from r7rs.
get-current-secondreturns the number of seconds elapsed since the UNIX/POSIX epoch (that is midnight January 1st, 1970, UTC).
NOTE: r7rs specifies TAI seconds, but for now we are sticking to POSIX here.
get-current-jiffiesreturns the number of jiffies (fractions of a second) elapsed since an arbitrary epoch that may change in each run of the klisp interpreter. Applicative
get-jiffies-per-secondcan be used to determine which fraction of a second a jiffy represents.
get-jiffies-per-secondreturns a constant representing the number of jiffies that correspond to one second.
file-exists?checks to see if a file named
stringshould be the name/path for an existing file.
delete-filedeletes the file named
string. If it doesn't exists or can't be deleted, an error is signaled. The result returned by
string1should be the name/path for an existing file,
string2should be the name/path for a non existing file.
rename-filerenames the file named
string2. If the file doesn't exists or can't be renamed for any reason, an error is signaled. The result returned by
SOURCE NOTE: this is missing from r7rs, it is taken from C, being quite similar to
These applicatives return respectively the script and interpreter arguments. The script arguments are a list of the arguments passed to the klisp interpreter starting from (and including) the script name. The interpreter arguments are the complete list of arguments passed to the klisp interpreter (including the name of the interpreter as the first item in the list, the interpreter flag arguments and the script name and arguments.
defined-environment-variable?returns true iff
stringrepresents a defined envrionment variable.
get-environment-variablereturns the value of the environment variable represented by
stringdoesn't represent a defined environment variable an error is signaled.