This library provides various generic utility procedures.
Utility procedures which operate on strings.
Return true if the given string str is the empty string.
(empty-string? str)Pad given string str with given padding string pad to length.
(pad-string str pad length)Convert string to a human readable representation as mandated by the ed list command.
(string->human-readable str)Join a list of path elements (i.e. strings) using / as a path separator.
(path-join . elems)Return amount of bytes in a string.
(count-bytes str)Procedures which deal with input/output.
Write lines, i.e. a list of non-newline terminated strings to a
given port. Returns the amount of bytes written to the port
(including any newline characters).
(lines->port lines port)Read from given port as a list of lines. Returns pair of retrieved
lines and total amount of bytes read from the port (including
newlines).
(port->lines port)Expects the mode field of file-stat and returns
if the mode indicates a regular file.
(is-regular? mode)Read a single UTF-8 character from a fileno. Return a false value if
end-of-file is reached. If EOF is reached within a multibyte sequence,
an exception is raised. This procedure uses file-read internally and
can thus—contrary to read-char—read beyond EOF.
(file-read-char fileno)Miscellaneous utility procedures.
Syntactic sugar to increment a number by one.
(inc n)Syntactic sugar to decrement a number by one.
(dec n)Identity function, always returns the given value.
(id x)Returns all values of an alist, discarding the keys.
(alist-values alist)Like display but prints multiple objects and adds a trailing newline.
(println . objs)Like println but allows specification of a custom output port.
(fprintln port . objs)Return path to home directory of current user.
This procedure emits an error if the environment variable HOME is unset.
(user-home)