| @@ -87,7 +87,7 @@ group type) "Dealing with types." caaadr "Shorthand for (car (car (car (cdr lst · 86 unmodified lines |
| 87 | 87 | group time) "Measuring, manipulating and displaying time." copy-tree "Return a recursive copy of the list.\n\nUnlike `copy-list`, this function copies subelements of the list\nrecursively." f32 "Construct a 32-bit floating point number." sin "Return the sine of `r`, where `r` is given in radians." io-copy "Copy bytes from the source IO object to the destination and return\nthe number of bytes copied. If `n` is provided, copy up to that many\nbytes." > "Return `T` if the arguments are in strictly decreasing order (previous\none is greater than the next one)." str-rune "Return the nth rune of the string.\n\nThrows an exception if the index `n` is out of bounds." foldl "Reduce the sequences to a single value by repeatedly applying the\nfunction left-associatively.\n\nThe function should be of the form `(fn e₁ e₂ … eₙ acc)`. For each\niteration each `eᵢ` will be set to successive values of the i'th\nsequence. The value `acc` will initially be set to `zero` and\nsubsequently to the previous value of the function application.\n\nThe iteration will terminate once the shortest sequence is exhausted.\n\nFor example, for two sequences (e₁ e₂ … eₙ) and (d₁ d₂ … dₙ), the\nresult will be:\n\n (fn eₙ dₙ (…(fn e₂ d₂ (fn e₁ d₁ zero))…))\n\nNote that `foldl` is tail call recursive." +os-version+ "The \"version\" of the operating system StreetLISP VM is running on.\n\nThe availability of the constant and its value depends on the\noperating system and is only provided for the user to see. No logic\nshould depend on it." abs "Return absolute value of the argument." with-output-to "Evaluate expressions in `body` with `*io-out*` set to `io` during the\nevaluation." *linefeed* "OS-specific _line_ _feed_ value.\n\nIt is preferred over hardcoded `\"\\n\"`, for portability." str? "Return `T` if the argument is a string, `NIL` otherwise." cons? "Return `T` if `v` is a cons cell, `NIL` otherwise." str-split "Return a list of substrings of `str` by splitting at any character in\nthe string `sep`. The splitting characters are removed.\n\nBy default the string is split on space, line feed (newline),\nhorizontal and vertical tab, and form feed.\n\nTrim removes empty strings from the list." io-read "Return a value of the specified type by reading it from the IO\nobject.\n\nThe `type` must specify a fixed-width number, pointer or rune.\n\nNumerical values may be read in a specific endianness order by setting\n`endian` to either `:little-endian` or `:big-endian`. Host CPU\nendianness is used if not specified.\n\nIf the parameter `n` is provided, read `n` values of the type,\nreturning an array of the values or a string when `type` is `utf8`." truncate "Return the integer value of `x` rounded toward zero.\n\nIf `x` is already an integer (or infinite, or NaN), result is `x`." aset! "Modify the sequence element specified by the subscripts and return the\nnew value. The sequence can be an array, vector, a list.\nMulti-dimensional sequences of variating types are also supported." - "Return the result of subtraction. With only one argument a\nnegation is performed." io-truncate "Truncate the underlying IO object to the specified number of bytes." makunbound "Make the symbol unbound." quasiquote "Same as `'expr` but allows evaluating (\"unquoting\") parts of\nthe expression." io-column! "Change the current column number of the IO object." copy-list "Return a copy of the list.\n\nThe number of elements to be copied can be limited with the optional\nargument `n`." logand "Return the result of bitwise AND operation on integers." time-now "Return the number of nanoseconds since Epoch (1970-01-01 00:00:00).\n\nThis measures the system-wide real (wall-clock) time." sinh "Return the hyperbolic sine of `x`." *argv* "The list of command line arguments.\n\nIf StreetLISP was started in interactive mode without a file specified\nfor execution, `*argv*` will be a list containing just one value - the\nname of the `sl` executable.\n\nOtherwise, the file specified for execution and the rest of the remaining\narguments will form the `*argv*` list.\n\nStreetLISP's own options, such as `-i` and `-H ...` will be stripped\nout in any case." top-level-exception-handler "Print the exception `e` and the stack trace to `*stderr*`.\n\nThis is the top level exception handler that is used by `load` and\n`repl` functions to handle exceptions that weren't handled at the\nlower level." identity "Return `v`." untrace "Disable tracing for the function bound to the symbol." count "Return the number of elements in the list that satisfy the predicate." io-pos "Return the current absolute position within the IO object in bytes." +most-positive-fixnum+ "A constant integer closest to positive infinity that can be\nrepresented by fixnum type on this particular platform." map-int "Return a list of elements generated by repeated calls to `fn`.\n\nThe lambda `fn` will be called with a single argument which is an\nincreasing number in the range `[0, count)` (exclusive). The\nresulting list contains the values returned by `fn`." table->assoc-list "Return the table converted to an association list (pairs of each\nkey and value)." length< "Shorthand for a bounded length test `(< (length seq) n)`." unless "Shorthand for `(if cond NIL body)`.\n\nA non-empty body is required." str->time "Return the number of nanoseconds since Epoch from a time and date\nformatted as a string.\n\nBecause the supported format is limited, the returned value will have\nprecision in seconds at most." get-syntax "Return a macro application function based on its name, or `NIL` if\nit's not defined." (doc |
| 88 | 88 | group table) "Tables of keys with associated values." ptr? "Return `T` if the argument is an abstract pointer, `NIL` otherwise." expt "Return the value of `x` raised to the power of `p`." io-read-all "Return a string containing all of the data read from the IO object\nuntil it ran out of data.\n\nAn empty string (`\"\"`) is returned if the IO object had no data." gc "Force a garbage collection run.\n\nOne does not need to execute this function manually since garbage\ncollection will happen automatically, based on the amount of data\nallocated." io-write "Write the value to the IO object, return the number of bytes written.\n\nThe value may be a string, a fixed-width number or pointer, a rune\nor an array.\n\nNumerical values may be written in a specific endianness order by\nsetting `endian` to either `:little-endian` or `:big-endian`. Host\nCPU endianness is used if not specified.\n\nWhen writing a rune or an array of runes, they will be converted and\nwritten as an UTF-8 string." table-invert "Return a new table with the keys and values from the original table\nbut entries _inverted_ - values to keys and keys to values.\n\nNote that if the original table had several keys mapped to the same\nvalue, only one such mapping will be stored in the new table." lz-unpack "Return decompressed data previously compressed using lz-pack.\n\nEither destination for the decompressed data or the expected size of\nthe decompressed data must be specified. In the latter case a new\narray is allocated." div "Return the quotient of the Euclidean division `a/n`." princ "Print the arguments to *io-out* with `*print-readably*` set to `NIL`." (doc |
| 89 | 89 | group struct) "Declaring and manipulating structures." last-cdr "Return the second element of the last cell in the list.\n\nIt will always evaluate to `NIL` with any proper list." trace "Enable tracing for the function bound to the symbol.\n\nWhen tracing is enabled for the function, before evaluating the call\nthe name and arguments will be printed to `*io-out*`." io-filename "Return the filename of the IO object." let* "Same as the first form of `let` but each of the binding\nexpressions may reference any of the varibles bound previously.\n\nIf a binding consists of a variable name alone, its value is\nset to `#<void>`." gensym? "Return `T` if the argument is a gensym, `NIL` otherwise." (doc |
| 90 | | −group syntax) "StreetLISP syntax and macros." defdoc "Define documentation for a top level term.\n\nUseful in cases where the documentation for a term has to be set\nindependent of the definition of said term, or an additional form\nwith the same name has to be documented.\n\nIf `term` is a function signature and `doc` is not specified, just\nthe signature will be included in the documentation, without\nreplacing any previously defined.\n\nFirst `doc` argument is supposed to be a string with the description\nof the term. The following arguments are expected to be optional tag\npairings that provide grouping for multiple symbols (`:doc-group`),\n\"see also\" references (`:doc-see`) and code examples (`:doc-example`).\n\nCustom formatting lambda (`:doc-fmt`) may be used to process the\ndocumentation string when it's printed with `(help ...)`. It's used\nby `defstruct` to provide full constructor description in the output." cdddr "Shorthand for (cdr (cdr (cdr lst)))." copy-table "Return a new copy of the table with the keys and values preserved.\n\nNo copies of the keys nor values are created - original ones are\nreused." set-car! "Modify a cons cell (a list) in-place by putting `new-first` as its\nfirst element (head of the list). Return the modified cons\ncell (list)." receive "Capture multiple-return values into the given identifiers and\nevaluate the body." partition "Return two lists where the first contains the elements of the original\nlist which satisfy the predicate and the second containing the rest of\nthe elements.\n\nBoth lists will have the elements appear in the same order as in the\noriginal list." dotimes "Execute expressions in a loop the specified number of times.\n\nThe argument `var` defines the loop variable name, the iteration\ncount and (optionally) the resulting expression to evaluate and\nreturn the value of:\n\n (var-name count (result-expr #<void>))\n\nIf `result-expr` is not specified, `#<void>` is used instead.\n\nThe variable is incremented by `1` after each iteration, with its\ninitial value set to `0`, and may be referenced in expressions of\nthe `body`." has? "Return `T` if the table has a value associated with the key, `NIL` otherwise." vec "Construct a vector containing the specified arguments." while "Evaluate the body expressions until `cond` evaluates to `NIL`." rune "Construct a rune from a Unicode code point. Without code point\nspecified, an \"invalid\" rune is returned." *exit-hooks* "Internal variable, a list containing functions to call right before VM\nprocess exits." cadar "Shorthand for (car (cdr (car lst)))." type-error "Raise a type error exception." file "Open a file for I/O.\n\nAn `io` object is returned. Without any modes specified the file\nmust already exist and is opened in read-only mode.\n\nFiles are created with the default mode bits #o644." nth "Return nth element of the list, or `NIL` if the list is shorter." cdr "Return the second element of a cons cell (tail of a list) or `NIL` if\nnot available." / "Return the division of the arguments. With only one argument the\nresult of `1/x` is returned. If the result is integer-valued, it is\nreturned as an integer." newline "Write a single OS-specific line feed to the output.\n\nOn most systems it's a single character - `#\\linefeed` (`\\n`)." separate-doc-from-body "Take a list of terms and return a pair `(doc . body)`, where the first\nelement contains a list of documentation-related terms, and the second\ncontains the rest of the terms." cdadar "Shorthand for (cdr (car (cdr (car lst))))." foldr "Reduce the sequences to a single value by repeatedly applying the\nfunction right-associatively.\n\nThe function should be of the form `(fn e₁ e₂ … eₙ acc)`. For each\niteration each `eᵢ` will be set to successive values of the i'th\nsequence. The value `acc` will initially be set to `zero` and\nsubsequently to the previous value of the function application.\n\nThe iteration will terminate once the shortest sequence is exhausted.\n\nFor example, for two sequences (e₁ e₂ … eₙ) and (d₁ d₂ … dₙ), the\nresult will be:\n\n (fn e₁ d₁ (fn e₂ d₂ (…(fn eₙ dₙ zero)…)))\n\nNote that `foldr` is NOT tail call recursive." sqrt "Return the square root of `x`." reverse "Return the list with its elements in reverse order.\n\nThe original list is copied to construct the reversed version." lz-pack "Return data compressed using Lempel-Ziv.\n\nThe data must be an array, returned value will have the same type.\nThe optional `level` is between `0` and `10`. With `level` set to\n`0` a simple LZSS using hashing will be performed. Levels between\n`1` and `9` offer a trade-off between time/space and ratio. Level\n`10` is optimal but very slow." *prompt* "Function called by REPL to tell the user it's expecting input.\n\nThe default `*prompt*` function prints `#;> `, which by itself is a\ncommented-out expression, allowing the user to copy-paste the entire\nline (with the prompt) to re-evaluate." member "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `equal?`." bignum? "Return `T` if the argument is a bignum, `NIL` otherwise." fixnum "Construct a fixnum." f64 "Construct a 64-bit floating point number." str->num "Return the number using the radix `base` in the string `s`.\n\nReturns `NIL` if the number could not be parsed or there were\nleft-over trailing characters." exp "Return the exponential - value of `e` (natural logarithms base) raised\nto the power of `p`." memq "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `eq?`." (doc |
| 90 | +group syntax) "StreetLISP syntax and macros." defdoc "Define documentation for a top level term.\n\nUseful in cases where the documentation for a term has to be set\nindependent of the definition of said term, or an additional form\nwith the same name has to be documented.\n\nIf `term` is a function signature and `doc` is not specified, just\nthe signature will be included in the documentation, without\nreplacing any previously defined.\n\nFirst `doc` argument is supposed to be a string with the description\nof the term. The following arguments are expected to be optional tag\npairings that provide grouping for multiple symbols (`:doc-group`),\n\"see also\" references (`:doc-see`) and code examples (`:doc-example`).\n\nCustom formatting lambda (`:doc-fmt`) may be used to process the\ndocumentation string when it's printed with `(help ...)`. It's used\nby `defstruct` to provide full constructor description in the output." cdddr "Shorthand for (cdr (cdr (cdr lst)))." copy-table "Return a new copy of the table with the keys and values preserved.\n\nNo copies of the keys nor values are created - original ones are\nreused." set-car! "Modify a cons cell (a list) in-place by putting `new-first` as its\nfirst element (head of the list). Return the modified cons\ncell (list)." receive "Capture multiple-return values into the given identifiers and\nevaluate the body." partition "Return two lists where the first contains the elements of the original\nlist which satisfy the predicate and the second containing the rest of\nthe elements.\n\nBoth lists will have the elements appear in the same order as in the\noriginal list." dotimes "Execute expressions in a loop the specified number of times.\n\nThe argument `var` defines the loop variable name, the iteration\ncount and (optionally) the resulting expression to evaluate and\nreturn the value of:\n\n (var-name count (result-expr #<void>))\n\nIf `result-expr` is not specified, `#<void>` is used instead.\n\nThe variable is incremented by `1` after each iteration, with its\ninitial value set to `0`, and may be referenced in expressions of\nthe `body`." has? "Return `T` if the table has a value associated with the key, `NIL` otherwise." vec "Construct a vector containing the specified arguments." while "Evaluate the body expressions until `cond` evaluates to `NIL`." rune "Construct a rune from a Unicode code point. Without code point\nspecified, an \"invalid\" rune is returned." *exit-hooks* "Internal variable, a list containing functions to call right before VM\nprocess exits." cadar "Shorthand for (car (cdr (car lst)))." type-error "Raise a type error exception." file "Open a file for I/O.\n\nAn `io` object is returned. Without any modes specified the file\nmust already exist and is opened in read-only mode.\n\nFiles are created with the default mode bits #o644." nth "Return nth element of the list, or `NIL` if the list is shorter." cdr "Return the second element of a cons cell (tail of a list) or `NIL` if\nnot available." / "Return the division of the arguments. With only one argument the\nresult of `1/x` is returned. If the result is integer-valued, it is\nreturned as an integer." newline "Write a single OS-specific line feed to the output.\n\nOn most systems it's a single character - `#\\linefeed` (`\\n`)." separate-doc-from-body "Take a list of terms and return a pair `(doc . body)`, where the first\nelement contains a list of documentation-related terms, and the second\ncontains the rest of the terms." cdadar "Shorthand for (cdr (car (cdr (car lst))))." foldr "Reduce the sequences to a single value by repeatedly applying the\nfunction right-associatively.\n\nThe function should be of the form `(fn e₁ e₂ … eₙ acc)`. For each\niteration each `eᵢ` will be set to successive values of the i'th\nsequence. The value `acc` will initially be set to `zero` and\nsubsequently to the previous value of the function application.\n\nThe iteration will terminate once the shortest sequence is exhausted.\n\nFor example, for two sequences (e₁ e₂ … eₙ) and (d₁ d₂ … dₙ), the\nresult will be:\n\n (fn e₁ d₁ (fn e₂ d₂ (…(fn eₙ dₙ zero)…)))\n\nNote that `foldr` is NOT tail call recursive." sqrt "Return the square root of `x`." reverse "Return the list with its elements in reverse order.\n\nThe original list is copied to construct the reversed version." lz-pack "Return data compressed using Lempel-Ziv.\n\nThe data must be an array, returned value will have the same type.\nThe optional `level` is between `0` and `10`. With `level` set to\n`0` a simple LZSS using hashing will be performed. Levels between\n`1` and `9` offer a trade-off between time/space and ratio. Level\n`10` is optimal but very slow." *prompt* "Function called by REPL to tell the user it's expecting input.\n\nThe default `*prompt*` function prints `#;> `, which by itself is a\ncommented-out expression, allowing the user to copy-paste the entire\nline (with the prompt) to re-evaluate." member "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `equal?`." bignum? "Return `T` if the argument is a bignum, `NIL` otherwise." fixnum "Construct a fixnum." f64 "Construct a 64-bit floating point number." str->num "Return the number using the radix `base` in the string `s`.\n\nReturns `NIL` if the number could not be parsed. Any number of leading\nand/or trailing whitespace runes is allowed and those will be ignored." exp "Return the exponential - value of `e` (natural logarithms base) raised\nto the power of `p`." memq "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `eq?`." (doc |
| 91 | 91 | group debug) "Debugging utilities." +most-negative-fixnum+ "A constant integer closest to negative infinity that can be\nrepresented by fixnum type on this particular platform." caaaar "Shorthand for (car (car (car (car lst))))." io-column "Return the current column number of the IO object.\n\nColumn number is purely informative and is only being automatically\nupdated with the files opened for reading. If the cursor position is\nchanged via `io-skip` or `io-pos!`, the behavior is undefined." traced? "Return `T` if the tracing is enabled for the function, `NIL`\notherwise." cond "Select one of the clauses by evaluating the condition, evaluate the\naccompanied expressions for the matching clause and return the result.\n\nDifferent clause form variants are available. The most common is\n`(test then…)`, which gives the result of `then…` if `test` did not\nevaluate to `NIL`. Second form, `(test)`, which gives the result\nof `test` unless it's `NIL`. Third form, `(test => fn)`, calls `fn`\nwith a single argument which is the non-`NIL` result of evaluating\n`test`.\n\nThe special `else` clause condition, if specified, is used as a fallback\nif none of the other conditions were satisfied. If none were satisfied\n_and_ `else` was not provided, `NIL` is returned." (doc |
| 92 | 92 | group io) "Files and I/O functionality." s64 "Construct a 64-bit signed number." io-flush "Flush the contents of the output buffer to the underlying IO." assoc "Return a pair of a matching key and the associated value, or `NIL` if\nnone matched. Keys are compared using `equal?`." + "Return sum of the arguments or `0` when none specified." path-delete "Delete the name from the filesystem.\n\nThrows an IO error if the path does not exist or it failed to be\nremoved." cadadr "Shorthand for (car (cdr (car (cdr lst))))." foldr1 "Same as `foldr` but using the first element of the sequence as the\ninitial accumulator." compare "Return -1 if `x` is less than `y`, 0 if equal, and `1` if `y` is\ngreater than `x`." length "Return the length of the sequence.\n\nString's length is measured in UTF-8 codepoints. For tables the number\nof key-value pairs is returned.\n\nNote: for circular lists the result is `NIL`. A type error exception is\nthrown on improper lists, which are not considered valid sequences." *io-err* "Current (default) error output IO stream.\n\nFunctions may use `*io-err*` for error output, which then can be\nredirected to a different IO using `with-bindings`." print-exception "Print the exception in a human-readable form.\n\nExceptions are lists containing various information about the error.\nThey may optionally, as the first element, contain the error location\nof the form `(io row column)`." error "Raise an error." set-top-level-value! "Evaluate the expression and assign the result to the symbol in the top\nlevel (global) environment.\n\nThe use of this function is discouraged. For the usual assignment of\nvalues to names it is recommended instead to use `(def …)` and/or\n`(set! …)`." load "Read and evaluate expression from the file or IO object.\n\nIf the argument is an IO object it is _not_ closed after the load\nfinishes." getpid "Return the process ID of the StreetLISP VM within the operating system\nit's running on." keyword? "Return `T` if the argument is a keyword, `NIL` otherwise." aref "Return the sequence element specified by the subscripts. The sequence\ncan be an array, vector, a list. Multi-dimensional sequences\nof variating types are also supported." sym? "Return `T` if `v` is a symbol, `NIL` otherwise." defmacro "Define a new macro." u64 "Construct a 64-bit unsigned number." int-valued? "Return `T` if `x` is a number and is equal (as in `=`) to an\ninteger value of `x`." Instructions "VM instructions mapped to their encoded byte representation." assv "Return a pair of a matching key and the associated value, or `NIL` if\nnone matched. Keys are compared using `eqv?`." bignum "Construct a bignum. As opposed to a fixnum, its value is not limited." copy-vec "Return a copy of the vector with the same elements.\n\nNo copies of the values themselves are created, the original values\nare reused." eqv? "Return `T` if both `a` and `b` are of the same value and primitive\n(leaf) type, `NIL` otherwise. Neither cons cell nor vector are not\nconsidered primitive types as they may define deep structures." +f64-epsilon+ "A smallest positive floating point number such that\n`(+ 1.0 +f64-epsilon+)` is not equal to `1.0`." list "Return a list constructed of the arguments." __init_globals "Initialize globals that need to be set at load time." eof? "Return `T` if the argument is `#<eof>`, `NIL` otherwise.\n\nThis object is returned by I/O functions to signal end of file,\nwhere applicable." +pi+ "Mathematical constant π." revappend "Return list with its elements in reverse order, with `tail` appended\nto its end.\n\nThe original list is copied to construct the reversed version." quote "Leave the expression unevaluated." nreconc "Return list with its elements in reverse order, with `tail` appended\nto its end.\n\nThe original list may be modified by this function." defc*r "Define a shorthand for list access using `car` and `cdr`." (doc |
| 93 | 93 | group misc) "Miscellaneous." read-all-of "Return the list containing the values returned by call `(fn io)` repeated\nuntil the IO object runs out of data." cddddr "Shorthand for (cdr (cdr (cdr (cdr lst))))." prog1 "Evaluate the expressions in order, return the result of the first\nexpression." logior "Return the result of bitwise OR (inclusive OR) operation on integers." cadr "Shorthand for `(car (cdr lst))`, that is, _first element of the\nsecond element_." cdadr "Shorthand for (cdr (car (cdr lst)))." (doc |