Up: API
Given a list of functions that don’t take any inputs, run each one of those functions and return a list of what each function returned.
Parse a URL-encoded bytevector HTTP BODY into an association list of key-value strings.
Return #t if OBJ is a valid association list (a list where every element is a pair), otherwise return #f.
Deeply look up a value within nested association lists XS by traversing the sequence of KEYS sequentially.
Look up FIELD in ALIST. Return the associated value if found, or an empty string "" if the field does not exist or matches #f.
Decode base64 encoded string S back into its raw string format by system execution. Trims trailing right whitespaces from output.
Encode string S into a base64 string without line wrapping by system execution.
Asset library is an in-memory cache, a lookup dictionary that can be used for faster performance, memoization, etc. This version will read from a list of files specified with the FILES param.
To use it, you can simply call the function with a list of file paths.
Return #t if S is exactly the empty string "".
Recursively flatten a nested list structure XS into a flat, one-dimensional list.
Apply PROC to the elements of LIST1 ... LISTN to build a result, and return that result. See the manual for details.
Undocumented procedure.
Retrieve the short Git commit SHA (7 characters) of the current repository state.
Undocumented procedure.
Get env VAR or return a DEFAULT value.
Replace special or non-ASCII characters in string X with their HTML entity equivalents.
Convert HTML entities inside string X back into their original character equivalents.
Return #t if S is a valid string and not equal to "", otherwise return #f.
Equivalent to open-pipe with mode OPEN_BOTH
Equivalent to open-pipe with mode OPEN_READ
Convert a key-value pair A into a SQL assignment clause string formatted as "column_name = value".
The key symbol is mapped via ‘symbol->sql-column‘. Booleans are converted to 1 or 0, numbers are unquoted, and all other types are single-quoted.
Returns a randomly shuffled copy of XS. List shuffle which implements the modern Fisher-Yates shuffle algorithm. It converts the list to a vector for efficient O(1) random access and mutation, shuffles the vector in-place, and then converts it back to a list.
Convert SQL column name string X into a Scheme symbol by replacing underscores with hyphens.
Transform a SQL row representation XS into a Scheme-idiomatic association list. If XS is an alist, it converts its column keys into hyphenated Scheme symbols. If XS is not an alist, it returns XS unaltered.
Undocumented procedure.
Return a substring of S with its first and last characters removed. If the string length is 2 or less, returns S unaltered.
Split string S by newlines, remove its first and last lines, and rejoin the remaining lines with newlines.
Return a substring of S with the first N characters and the final 1 character removed. If the string length is 2 or less, returns S unaltered.
Return a new string where every instance of substring in string str has been replaced by replacement. For example:
(string-replace-substring "a ring of strings" "ring" "rut") ⇒ "a rut of struts"
Convert Scheme symbol X into a SQL column name string by replacing hyphens with underscores.
Convert a list of symbols XS into a single string of comma-separated SQL column names.
Execute system shell command CMD via an input pipe and return the captured standard output as a string.
Percent-decode the given STR, according to ENCODING, which should be the name of a character encoding.
Note that this function should not generally be applied to a full URI string. For paths, use ‘split-and-decode-uri-path’ instead. For query strings, split the query on ‘&’ and ‘=’ boundaries, and decode the components separately.
Note also that percent-encoded strings encode _bytes_, not characters. There is no guarantee that a given byte sequence is a valid string encoding. Therefore this routine may signal an error if the decoded bytes are not valid for the given encoding. Pass ‘#f’ for ENCODING if you want decoded bytes as a bytevector directly. ‘set-port-encoding!’, for more information on character encodings.
If DECODE-PLUS-TO-SPACE? is true, which is the default, also replace instances of the plus character (+) with a space character. This is needed when parsing application/x-www-form-urlencoded data.
Returns a string of the decoded characters, or a bytevector if ENCODING was ‘#f’.
Percent-encode any character not in the character set, UNESCAPED-CHARS.
The default character set includes alphanumerics from ASCII, as well as the special characters ‘-’, ‘.’, ‘_’, and ‘~’. Any other character will be percent-encoded, by writing out the character to a bytevector within the given ENCODING, then encoding each byte as ‘%HH’, where HH is the uppercase hexadecimal representation of the byte.
Undocumented procedure.
Convert a Scheme value A into its raw SQL literal string representation. Numbers are kept raw, booleans are mapped to "1" or "0", and other types are wrapped in single quotes. You should escape single quotes if needed yourself.
THUNK must be a procedure of no arguments, and FILE must be a string naming a file. The effect is unspecified if the file already exists. The file is opened for output, an output port connected to it is made the default value returned by ‘current-output-port’, and the THUNK is called with no arguments. When the THUNK returns, the port is closed and the previous default is restored. Returns the values yielded by THUNK. If an escape procedure is used to escape from the continuation of these procedures, their behavior is implementation dependent.
Undocumented procedure.
Calls THUNK and returns its output as a string.
Up: API