| @@ -40,7 +40,7 @@ docs… options… (slot-1 DEFAULT) slot-2 slot-3) · 39 unmodified lines |
| 40 | 40 | seq)) buffer (NIL (v (:start NIL) (:end NIL))) find-program ((name)) random-state? ((state)) assoc-list (kvs) process-close ((p)) builtin? ((v)) with-input (((var |
| 41 | 41 | expr) . body)) str-map ((fn s)) macroexpand-1 ((e)) remove-duplicates ((lst)) with-exception-bindings (body) str (terms) negative? ((n)) void (rest) io-read-line ((io)) assert-fail ((expr . what)) and (rest) 1- ((n)) io-buffer-mode ((io)) equal? ((a |
| 42 | 42 | b)) unquote ((expr)) cddar ((lst)) or (rest) rune-lower-case? ((r)) make-process ((path args |
| 43 | | −(:input NIL) (:output NIL) (:error NIL))) = ((n . rest)) fn? ((v)) caaadr ((lst)) make-system-image ((filename)) subseq ((seq |
| 43 | +(:in NIL) (:out NIL) (:err NIL))) = ((n . rest)) fn? ((v)) caaadr ((lst)) make-system-image ((filename)) subseq ((seq |
| 44 | 44 | start (end NIL))) set! ((id expr . rest)) vm-stats (((io *io-out*))) ptr (((n 0))) caddar ((lst)) print-stack-trace ((st)) cosh ((x)) values (v) < ((v . rest)) copy-tree ((lst)) f32 (((n |
| 45 | 45 | 0.0))) sin ((r)) io-copy ((io-dest io-src (n NIL))) > ((v . rest)) str-rune ((s n)) foldl ((fn |
| 46 | 46 | zero . seqs)) with-output-to ((io . body)) abs ((n)) str? ((v)) cons? ((v)) io-read ((io |
| @@ -86,7 +86,7 @@ group compare) "Comparison operators." cdddar "Shorthand for (cdr (cdr (cdr (ca · 39 unmodified lines |
| 86 | 86 | group array) "Arrays and vectors." rune-titlecase "Return the title case version of the rune.\n\nFor most runes the result is the same as with `rune-upcase`." unquote-nsplicing "Evaluate the expression, which is a part of a quasiquoted expression\nitself, and \"splice\" it at the location.\n\nUnlike `unquote-splicing`, this macro may operate destructively\non the list produced." num->str "Return the number formatted as a string.\n\nFloating point numbers can only be formatted in base 10. Bignums are\nsupported with bases 2, 4, 8, 10, 16 and 32. The rest of the\nnumerical types are valid for any base from 2 to 36.\n\nNote: unlike other LISP dialects, StreetLISP's base-32 encoding is\ndone according to RFC 4648." mod "Return the remainder of the Euclidean division `a/n`." if "Return the result of `then` if `cond` evaluated as \"true\", `else`\notherwise.\n\nThe `else` is not optional unlike in many other LISP implementations.\nPrimary purpose is to spot errors involving wrong parenthesis\nplacement. Another reason is to force a certain code style." str-pad "Return the string padded until the given length.\n\nBy default the string is padded with spaces on the right." p32 "Construct a 32-bit abstract pointer value." case "Evaluate an expression, select one of the clauses by matching\nthe result with `eqv?`, and return the result of the clause.\n\nThe special `else` clause matching expression, if specified, is\nused as a fallback if none of the clauses matched the result.\nIf no `else` was specified and no matches occured, `NIL` is\nreturned." io-read-lines "Return a list of lines read from the IO object until it ran out of\ndata.\n\nThe file is split into lines by `#\\linefeed`. Each string will have\nthe character, except the last line if EOF has been reached\nbeforehand." io-line "Return the current line number of the IO object.\n\nLine 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." zip-with "Return a list where each nth element is the result of the supplied\nfunction applied to the corresponding elements from the parameter lists.\n\nThe resulting list is as long as the shortest of the arguments." trycatch "Return the result of evaluation of the expression `try` or, if an\nexception has been thrown, the one-argument function `catch`." (doc |
| 87 | 87 | group builtin) "Built-in operators." macrocall? "Return the macro application function if `e` refers to a macro call,\n`NIL` otherwise." iterate "Return the list of length `n` containing results of applying function\n`fn` to `zero`, 0 through `n` times.\n\nThe result is of form\n\n [zero (fn zero) (fn (fn zero)) (fn (fn (fn zero))) …]" *syntax-environment* "Table containing macro definitions.\n\nThe keys are macro names, the values are their application functions." builtin "Return the builtin associated with the symbol.\n\nThrows an exception if no such builtin exists." table-values "Return the list of all values of the table." macroexpand "Return a fully macro-expanded expression.\n\nExpansion will continue until no more macro calls are left." caadr "Shorthand for (car (car (cdr lst)))." type-of "Return the underlying type of the value." top-level-value "Return the value bound to the symbol in the top level (global)\nenvironment." defstruct "Declare a new structure type with the specified name and slots.\n\nThe default underlying type is a \"named\" vector (`:type vec`), where\nthe first element is the name of the structure's type, the rest are\nthe keyworded slot values. A list with slot values alone can be used\ninstead by adding `:type list` option. The list will not contain the\nname of the struct by default, which can be enabled with `:named T`\noption.\n\nAs an example, the following declaration generates the default\nconstructor for a structure of three slots, with one of them (`c`)\nhaving a non-`NIL` default value and marked as read-only:\n\n (defstruct blah \"Return stuff.\" :doc-group stuff a b (c 1 :read-only T))\n ; (make-blah (:a NIL) (:b NIL) (:c 1))\n ; (blah-a s)\n ; (blah-b s)\n ; (blah-c s)\n ; (blah-a! s new-a)\n ; (blah-b! s new-b)\n\nSlot's options, if any, should be specified after its default value.\nSupported options are:\n\n ; mark the slot as read-only\n ; its value can be read, but trying to modify it will throw an error\n … :read-only T\n\nThe constructor can be changed in several ways:\n\n ; disable the constructor altogether\n (defstruct blah :constructor NIL a b c)\n ; only change its name\n (defstruct blah :constructor blargh a b c)\n ; rename AND avoid using keywords\n (defstruct blah :constructor (blah a b c) a b c)\n\nThe option `:conc-name` specifies the slot accessor/setter prefix,\nwhich defaults to `structname-`. Prefix can be disabled entirely with\n`:conc-name NIL`.\n\nSlot setters are generated for writable slots by appending `!`\n(exclamation mark) to the accessor's name.\n\nDefault predicate can be disabled or its name, which defaults to\n`structname?`, changed:\n\n ; use \"blargh?\" instead of \"blah?\"\n (defstruct blah :predicate blargh? a b c)\n ; without predicate\n (defstruct blah :predicate NIL a b c)" caadar "Shorthand for (car (car (cdr (car lst))))." foldl1 "Same as `foldl` but using the first element of the sequence as the\ninitial accumulator." buffer "Return an in-memory buffer for I/O, of `io` type.\n\nIn the first form an empty buffer for both reading and writing is returned.\n\nA read-only buffer pointing at the underlying data of `v` is returned in\nthe second form. Optionally, the range of the data (measured in bytes)\navailable when accessing the buffer may be limited by using `:start` and/or\n`:end` keyworded arguments." find-program "Returns the full path to an executable by its name, or `NIL` if not found." random-state? "Return `T` if the argument is a random state object, `NIL` otherwise." assoc-list "Construct an association list from the arguments.\n\nEvery two arguments are expected to be a key and a value associated\nwith that key." process-close "Close any streams connected to the process." builtin? "Return `T` if `v` is a built-in function implemented in C, `NIL`\notherwise." with-input "Evaluate expressions in `body` with `var` bound to a readable buffer\ncontaining the result of the expression during the evaluation.\n\nOptionally, the range of the data (measured in bytes) available\nwhen accessing the buffer may be limited by using `:start` and/or\n`:end` keyworded arguments.\n\nThe result returned will be that of the last expression in the `body`." str-map "Return the concatenation of the values produced by `fn` when applying\nto each rune of the string `s`.\n\nFunction `fn` may return a value of any type suitable for `io-write` -\na rune, string, array of C primitives. If `fn` returns `NIL`, the\nrune is ignored." macroexpand-1 "Return a macro-expanded expression.\n\nIf the expression is not a macro call, it is returned unchanged.\nOnly a single level of expansion is performed." +endianness+ "Endianess of the CPU the VM is running on, a constant.\n\nSet to either `:big-endian` or `:little-endian`." remove-duplicates "Return a copy of the list with duplicated elements removed.\n\nElements are tested for duplicates using `equal?`. The order of the\nelements is preserved in the resulting list." with-exception-bindings "Bind `*print-…` variables to their `*exception-print-…` counterparts\nevaluate the body." str "Return concatenation of terms formatted as strings.\n\nThis is equivalent to `(princ terms…)`, except the string is\n_returned_, rather than printed." negative? "Return `T` if `n` is a negative number. Shorthand for `(< n 0)`." void "Return the constant `#<void>` while ignoring any arguments.\n\n`#<void>` is mainly used when a function has side effects but does not\nproduce any meaningful value to return, so even though `T` or `NIL` could\nbe returned instead, in case of `#<void>` alone, REPL will not print\nit." io-read-line "Return a single line of input read from `io`.\n\nReading stops at either a `#\\linefeed` character or upon reaching EOF.\nThe line feed character is included in the returned value unless EOF\nhas been reached beforehand.\n\nEOF (`#<eof>`) is returned if the IO object had no data." assert-fail "Throw an \"assertion failed\" exception if evaluating `expr` itself does\nnot result in an exception thrown. Return `T` otherwise.\n\nTo test for a specific exception type, an optional `what` argument can\nbe used." and "Return `NIL` and stop evaluating the arguments if one of them\nevaluated to `NIL`. Return the last value otherwise." 1- "Equivalent to `(- n 1)` - decrement by one." io-buffer-mode "Return the output buffering mode of the writable IO.\n\nPossible values include:\n\n* `NIL` - no buffering, data is written immediately\n* `:line` - data is written when `#\\newline` is encountered\n* `:block` - data is written when the buffer is full\n* `:memory` - the IO is an in-memory buffer itself" that "The result of the last expression evaluated in the REPL." (doc |
| 88 | 88 | group prop) "Dealing with properties of symbols." equal? "Return `T` if both `a` and `b` are of the same value. For non-leaf\ntypes (cons cell and vector), the equality test is performed\nthroughout the whole structure of the values." unquote "Evaluate the expression, which is a part of a quasiquoted expression\nitself, and insert it at the location." (doc |
| 89 | | −group vm) "VM-related functions." *interactive* "Variable indicating whether VM is running in \"interactive\" mode (`T`,\nREPL is active) or not (`NIL`, REPL is not active).\n\nInteractive mode can be forced by adding `-i` as the first command\nline argument." or "Return the first evaluated argument that is not `NIL` and stop\nevaluating the rest of the arguments. Return `NIL` otherwise." rune-lower-case? "Return `T` if the rune is a lower case one, `NIL` otherwise." make-process "Run an external program with the specified arguments.\n\nThe program is specified by its full path to the executable (`\"/bin/ls\"`). See\n`find-program` for an easy way to locate programs by their name alone.\n\nFirst element in the list of arguments, by convention, is usually the program's name.\n\nBy default, standard input, output and error streams are assigned to `/dev/null` by\nspecifying is as `NIL`. To inherit any of the streams from the main (StreetLISP) process\nitself, it should be assigned to `T` instead. One can also set it to a string path instead,\nin which case for output and error streams the files will be created (or truncated)\nautomatically. Existing streams can be passed as well, if any specific file modes (like\n`:append`, see `(help file)`) are needed. A special variant, `:stream` is used to create\na pipe - that is useful when dynamic communication with the running process is wanted." cddar "Shorthand for (cdr (cdr (car lst)))." = "Numerical equality test. Return `T` if all numbers are equal,\n`NIL` otherwise." fn? "Return `T` if `v` is a function, `NIL` otherwise." (doc |
| 89 | +group vm) "VM-related functions." *interactive* "Variable indicating whether VM is running in \"interactive\" mode (`T`,\nREPL is active) or not (`NIL`, REPL is not active).\n\nInteractive mode can be forced by adding `-i` as the first command\nline argument." or "Return the first evaluated argument that is not `NIL` and stop\nevaluating the rest of the arguments. Return `NIL` otherwise." rune-lower-case? "Return `T` if the rune is a lower case one, `NIL` otherwise." make-process "Run an external program with the specified arguments.\n\nThe program is specified by its full path to the executable (`\"/bin/ls\"`). See\n`find-program` for an easy way to locate programs by their name alone.\n\nFirst element in the list of arguments, by convention, is usually the program's name.\n\nBy default, standard input, output and error streams are assigned to `/dev/null` by\nspecifying is as `NIL`. To inherit any of the streams from the main (StreetLISP) process\nitself, it should be assigned to `T` instead. One can also set it to a string path instead,\nin which case for output and error streams the files will be created (or truncated)\nautomatically. Existing streams can be passed as well, if any specific file modes (like\n`:append`, see `(help file)`) are needed. A special variant, `:stream` is used to create\na pipe - that is useful when dynamic communication with the running process is wanted.\nA construct `:err :out` will direct both standard output and error output to the same stream." cddar "Shorthand for (cdr (cdr (car lst)))." = "Numerical equality test. Return `T` if all numbers are equal,\n`NIL` otherwise." fn? "Return `T` if `v` is a function, `NIL` otherwise." (doc |
| 90 | 90 | group type) "Dealing with types." caaadr "Shorthand for (car (car (car (cdr lst))))." make-system-image "Build and store a \"system image\" of the runtime environment to a file." subseq "Return a bounded part of a sequence.\n\nThe returned value is always a copy of the subsequence of the\noriginal. It is an error if either `start` or `end` (if specified)\nare out of bounds." set! "Evaluate the expression, assign the result to the identifier and\nreturn the value.\n\nThe identifier must already be bound in the same environment,\notherwise this results in a compilation error.\n\nMultiple identifiers and expressions may be specified in pairs. The\nreturned value will be the result of the last expression." vm-stats "Print various VM-related information, such as the number of GC\ncalls so far, heap and stack size, etc." ptr "Construct an abstract pointer value. The bit width is either 32-bit\nor 64-bit, depending on the platform the code is executing on.\n\nNote: certain arithmetic operations on pointers, such as division and\nmultiplication, will throw an error. This is done on purpose since\ndoing that on pointers rarely makes sense." caddar "Shorthand for (car (cdr (cdr (car lst))))." print-stack-trace "Print the stacktrace." *stdin* "Standard input IO stream." cosh "Return the hyperbolic cosine of `x`." values "Return the supplied values as multiple-return values." < "Return `T` if the arguments are in strictly increasing order (next\none is greater than the previous one). With a single argument\nthe result is always `T`." (doc |
| 91 | 91 | 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." 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`." 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." 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 |
| 92 | 92 | 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." rune-whitespace? "Return `T` if the rune is whitespace, `NIL` otherwise." div "Return the quotient of the Euclidean division `a/n`." princ "Print the arguments to *io-out* with `*print-readably*` set to `NIL`." (doc |