shithub: sl

Download patch

ref: a1dcc1641c851173013c7e51d350dd9426d5cc56
parent: dc6306e051c74dfa60865db0cc0bbf11b37aaecf
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Apr 27 14:05:11 EDT 2025

more docs

--- a/boot/sl.boot
+++ b/boot/sl.boot
@@ -13,53 +13,62 @@
               #fn("z0700}2:" #(aset!) 6) NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL #fn("n3012082>1|:" #(#fn("n1A061:" 6)) 7)
               NIL NIL NIL NIL NIL NIL NIL NIL #fn("z0700}2:" #(aref) 6) NIL NIL)
             *properties* #table(*formals-list* #table(rand-f32 (NIL)  bound? ((symbol))  identity ((x))  sym-set-doc ((symbol
-  doc-seq . formals-list))  odd? ((x))  list? ((a))  io-eof? ((io))  < ((a . rest))  cadr ((cell))  sym (term)  nan? ((v))  for ((min
+  doc-seq . formals-list))  odd? ((x))  list? ((v))  io-eof? ((io))  table? ((v))  < ((a . rest))  cadr ((cell))  sym (term)  nan? ((v))  ptr? ((v))  for ((min
   max fn))  fixnum? ((v))  exit (((status NIL)))  assoc ((key lst))  > ((a . rest))  + (rest)  div0 ((a
   b))  __finish ((status))  lz-unpack ((data :to destination)
                                        (data :size decompressed-bytes))  defstruct ((name docs…
   options… (slot-1 DEFAULT) slot-2 slot-3)
                                                                                     (name (:type 'vec)
-  (:named T) (:constructor T) (:conc-name T) (:predicate T) . slots))  compare ((x y))  buffer (NIL)  num? ((v))  add-exit-hook ((fun))  assoc-list (kvs)  assert ((expr))  builtin? ((v))  set-car! ((cell
-  new-first))  doc-group ((group-name doc))  cons? ((v))  1+ ((n))  even? ((x))  aref ((sequence
-                                                                                        subscript0 . rest))  zero? ((x))  vec (rest)  >= ((a . rest))  sym? ((v))  void? ((x))  proper-list? ((a))  length= ((seq
-  n))  positive? ((x))  doc-for ((term . doc))  aset! ((sequence subscripts… new-value))  car ((lst))  <= ((a . rest))  str (term)  cons ((first
+  (:named T) (:constructor T) (:conc-name T) (:predicate T) . slots))  abs ((x))  compare ((x y))  buffer (NIL)  num? ((v))  gensym? ((v))  add-exit-hook ((fun))  assoc-list (kvs)  assert ((expr))  str? ((v))  builtin? ((v))  set-car! ((cell
+  new-first))  cons? ((v))  doc-group ((group-name doc))  keyword? ((v))  1+ ((n))  even? ((x))  aref ((sequence
+  subscript0 . rest))  zero? ((x))  vec (rest)  >= ((a . rest))  sym? ((v))  void? ((x))  arr? ((v))  proper-list? ((v))  int? ((v))  positive? ((x))  random ((n))  doc-for ((term . doc))  length= ((seq
+  n))  aset! ((sequence subscripts… new-value))  car ((lst))  <= ((a . rest))  str (term)  cons ((first
   second))  - ((a . rest))  remprop ((symbol key))  negative? ((x))  rand (NIL)  void (rest)  assert-fail ((expr . what))  file ((path
-  (:read NIL) (:write NIL) (:create NIL) (:truncate NIL) (:append NIL)))  assv ((key lst))  1- ((n))  atom? ((value))  cdr ((lst))  vec? ((v))  / ((x . rest))  equal? ((a
-  b))  min ((x0 . xs))  eqv? ((a b))  io? ((term))  eof-object? ((term))  list (rest)  apply ((fn
-  arg . rest))  help ((term (kind NIL) (:print-header help-print-header)))  memv ((item lst))  max ((x0 . xs))  rand-u32 (NIL)  = ((a . rest))  rand-u64 (NIL)  not ((v))  separate-doc-from-body ((body
-  (doc NIL)))  set-cdr! ((cell new-second))  fn? ((v))  rand-f64 (NIL)  lz-pack ((data (level 0)))  help-print-header ((term
-  sigs (:kind NIL) (:lpad "")))  member ((item lst))  eq? ((a b))  *prompt* (NIL)  getprop ((symbol
-  key (def NIL)))  putprop ((symbol key val))  vm-stats (NIL)  * (rest)  io->str ((io)))  *doc* #table(sym-set-doc "Set the documentation for the symbol."  io-eof? "Return `T` if `io` is currently in the \"end of file\" state, `NIL`\notherwise."  cadr "Shorthand for `(car (cdr cell))`, that is, _first element of the\nsecond element_.\n\nExamples:\n\n    (cadr '(1 2 3)) → 2\n    (cadr '(1))     → NIL\n    (cadr NIL)      → NIL"  nan? "Return `T` if `v` is a floating point representation of NaN, either\nnegative or positive, `NIL` otherwise."  fixnum? "Return `T` if `v` is of a fixnum type, `NIL` otherwise."  exit "Terminate the process with the specified status.  Does not return.\nThe status is expected to be a string in case of an error.\n\nExamples:\n\n    (exit) ; exit with status 0 (nil on Plan 9)\n    (exit \"error\") ; exit with status 1 (\"error\" on Plan 9)"  __finish "A function called right before exit by the VM."  div0 "Return the quotient of two numbers.  For non-integers this is\nequivalent to `(div0 (floor a) (floor b))`.  The result is always an\ninteger.\n\nExamples:\n\n    (div0 7 2)     → 3\n    (div0 10 -2)   → -5\n    (div0 6.9 1.9) → 6"  (doc
+  (:read NIL) (:write NIL) (:create NIL) (:truncate NIL) (:append NIL)))  assv ((key lst))  1- ((n))  atom? ((v))  cdr ((lst))  vec? ((v))  / ((x . rest))  equal? ((a
+  b))  min ((x0 . xs))  eqv? ((a b))  io? ((term))  eof-object? ((v))  list (rest)  apply ((fn arg . rest))  help ((term
+  (kind NIL) (:print-header help-print-header)))  memv ((item lst))  max ((x0 . xs))  rand-u32 (NIL)  = ((a . rest))  rand-u64 (NIL)  not ((v))  separate-doc-from-body ((body
+  (doc NIL)))  set-cdr! ((cell new-second))  closure? ((v))  fn? ((v))  rand-f64 (NIL)  lz-pack ((data
+  (level 0)))  help-print-header ((term sigs (:kind NIL) (:lpad "")))  member ((item lst))  eq? ((a
+  b))  rune? ((v))  getprop ((symbol key (def NIL)))  vm-stats (NIL)  * (rest)  putprop ((symbol
+  key val))  *prompt* (NIL)  io->str ((io)))  *doc* #table(sym-set-doc "Set the documentation for the symbol."  io-eof? "Return `T` if `io` is currently in the \"end of file\" state, `NIL`\notherwise."  cadr "Shorthand for `(car (cdr cell))`, that is, _first element of the\nsecond element_.\n\nExamples:\n\n    (cadr '(1 2 3)) → 2\n    (cadr '(1))     → NIL\n    (cadr NIL)      → NIL"  nan? "Return `T` if `v` is a floating point representation of NaN, either\nnegative or positive, `NIL` otherwise."  ptr? "Return `T` if the argument is an abstract pointer, `NIL` otherwise."  fixnum? "Return `T` if `v` is of a fixnum type, `NIL` otherwise."  exit "Terminate the process with the specified status.  Does not return.\nThe status is expected to be a string in case of an error.\n\nExamples:\n\n    (exit) ; exit with status 0 (nil on Plan 9)\n    (exit \"error\") ; exit with status 1 (\"error\" on Plan 9)"  __finish "A function called right before exit by the VM."  div0 "Return the quotient of two numbers.  For non-integers this is\nequivalent to `(div0 (floor a) (floor b))`.  The result is always an\ninteger.\n\nExamples:\n\n    (div0 7 2)     → 3\n    (div0 10 -2)   → -5\n    (div0 6.9 1.9) → 6"  (doc
   group prop) "Dealing with symbols' properties."  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."  defstruct "Defines a structure type with a specific 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\n\n    (defstruct blah \"Return stuff.\" :doc-group stuff a b (c 1 :read-only T))\n\nGenerates the default constructor for a structure of three slots, with\nthe third (`c`) having a specific default value and being read-only.\n\n    (make-blah (:a NIL) (:b NIL) (:c 1))\n    (blah-a s)\n    (blah-b s)\n    (blah-c s)\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 prefix, which\ndefaults to `structname-`.  Prefix can be disabled entirely with\n`:conc-name NIL`.\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)"  (doc
-  group compare) "Comparison operators."  buffer "Return an in-memory buffer for I/O, of `io` type.\n\nA buffer can be used for both reading and writing at the same\ntime."  num? "Return `T` if `v` is of a numerical type, `NIL` otherwise.\n\nNumerical types include floating point, fixnum, bignum, etc.\nNote: ironically, a NaN value is considered a number by this function\nsince it's only testing the _type_ of the value."  assoc-list "Return an association list built of the arguments.\n\nEvery two arguments are expected to be a key and a value associated\nwith that key.\n\nExamples:\n\n    (assoc-list 'a 0 'b 1) → ((a . 0) (b . 1))"  assert "Throw an exception if `expr` evaluates to `NIL`.  Return `T` in any\nother case.\n\nExamples:\n\n    (def s \"abc\")\n    (assert (= (length s) 3))         → T\n    (assert (eq? (str-rune s 0) #\\x)) → assertion failed: ..."  builtin? "Return `T` if `v` is a built-in function implemented in C, `NIL`\notherwise.\n\nExamples:\n\n    (builtin? map)         → T\n    (builtin? macroexpand) → NIL"  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).\n\nExamples:\n\n    (def q '(1 2 3 4 5))\n    (set-car! q 0) → (0 6 7)\n    q              → (0 6 7)"  (doc
-  group debug) "Debugging utilities."  1+ "Equivalent to `(+ n 1)`."  vec "Return a vector constructed of the arguments.\n\nExamples:\n\n    (vec)              → #() ; empty vector\n    (vec 1 2.5 \"a\" 'b) → #(1 2.5 \"a\" b)"  positive? "Return `T` if `x` is greater than zero."  *builtins* "VM instructions as closures."  str "Return concatenation of terms formatted as strings.\n\nThis is equivalent to `(princ terms…)`, except the string is\nreturned, rather than printed.\n\nExamples:\n\n    (str \"a\" 'b 1 #(0)) → \"ab1#(0)\""  remprop "Remove a property value associated with the symbol."  negative? "Return `T` if `x` is negative."  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."  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.\n\nExamples:\n\n    (def s \"abc\")\n    (assert-fail (= (length s) 3))   → assertion failed: ...\n    (assert-fail (= s 1) type-error) → T"  (doc
-  group list) "Working with lists."  file "Open a file for I/O.\n\nAn `io` object is returned.  Without any modes specified the file\nis opened in read-only mode."  1- "Equivalent to `(- n 1)`."  cdr "Return the second element of a cons cell (tail of a list) or `NIL` if\nnot available.\n\nExamples:\n\n    (cdr NIL)      → NIL\n    (cdr '(1 2 3)) → (2 3)\n    (cdr '(1 . 2)) → 2"  atom? "Return `T` if `v` is a _not_ a cons cell, `NIL` otherwise.  This is\nthe opposite of `cons?`.\n\nThe term \"atom\" comes from the idea of being indivisible.\n\nExamples:\n\n    (atom? \"a\")  → T\n    (atom? NIL)  → T\n    (atom? '(1)) → NIL"  / "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.\n\nExamples:\n\n    (/ 2)       → 0.5\n    (/ 7 2 2)   → 1.75\n    (/ 10 -2)   → -5 ; a fixnum\n    (/ 6.9 1.9) → 3.6315…"  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.\n\nExamples:\n\n    (equal? 0.0 0) → NIL\n    (equal? 0 0)   → T\n    (def a \"1\")\n    (def b \"1\")\n    (equal? a b)   → T\n    (def a '(1))\n    (def b '(1))\n    (equal? a b)   → T"  apply "Return the result of applying a function to a list of arguments.\n\nThe last argument must always be a list which gets spliced as\narguments to the function.\n\nExamples:\n\n    (apply + 1 2 '(3 4 5))   → 15\n    (apply vec '(1 2 3))     → #(3 4 5)\n    (apply arr 'u8 '(3 4 5)) → #vu8(3 4 5)"  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."  = "Numerical equality test.  Return `T` if all numbers are equal,\n`NIL` otherwise."  rand-u64 "Return a random integer on interval [0, 2⁶⁴-1]."  (doc
-  group sys) "OS-specific functions."  not "Return `T` if `v` is `NIL`, `T` otherwise."  set-cdr! "Modify a cons cell (a list) in-place by putting `new-second` as its\nsecond element (tail of the list).  Return the modified cons\ncell (list).\n\nExamples:\n\n    (def q '(1 2 3 4 5))\n    (set-cdr! q '(6 7)) → (1 6 7)\n    q                   → (1 6 7)"  fn? "Return `T` if `v` is a function, `NIL` otherwise.\n\nExamples:\n\n    (fn? map)         → T\n    (fn? macroexpand) → T"  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 signal the user input is required.\n\nDefault function prints `#;> `."  member "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `equal?`.\n\nExamples:\n\n    (member 1 '(3 2 1 0)) → (1 0)\n    (member 1 '(2 3))     → NIL"  eq? "Return `T` if `a` and `b` are the same object, `NIL` otherwise.\n\nExamples:\n\n    (eq? 0.0 0) → NIL\n    (eq? 0 0)   → T\n    (def a \"1\")\n    (def b \"1\")\n    (eq? a b)   → NIL\n    (def a '(1))\n    (def b '(1))\n    (eq? a b)   → NIL"  getprop "Return a property value associated with the symbol or `def` if\nmissing."  vm-stats "Print various VM-related information, such as the number of GC\ncalls so far, heap and stack size, etc."  * "Return product of the arguments or `1` when none specified."  putprop "Associate a property value with the symbol."  io->str "Return an in-memory `io` buffer converted to a string."  rand-f32 "Return a random 32-bit floating pointer number on [0.0, 1.0] interval."  bound? "Return `T` if `symbol` has a value associated with it, `NIL` otherwise."  odd? "Return `T` if `x` is an odd integer, `NIL` otherwise."  list? "Return `T` if the value is either `NIL` or a cons cell, `NIL`\notherwise."  (doc
-  group io) "I/O functionality."  < "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`."  sym "Return a symbol with the name being the concatenation of terms\nformatted as strings.\n\nThis is equivalent to `(sym (str terms…))`.\n\nExamples:\n\n    (sym \"a\" 'b 1) → ab1"  (doc
+  group compare) "Comparison operators."  buffer "Return an in-memory buffer for I/O, of `io` type.\n\nA buffer can be used for both reading and writing at the same\ntime."  num? "Return `T` if `v` is of a numerical type, `NIL` otherwise.\n\nNumerical types include floating point, fixnum, bignum, etc.\nNote: ironically, a NaN value is considered a number by this function\nsince it's only testing the _type_ of the value."  gensym? "Return `T` if the argument is a gensym, `NIL` otherwise."  assoc-list "Return an association list built of the arguments.\n\nEvery two arguments are expected to be a key and a value associated\nwith that key.\n\nExamples:\n\n    (assoc-list 'a 0 'b 1) → ((a . 0) (b . 1))"  assert "Throw an exception if `expr` evaluates to `NIL`.  Return `T` in any\nother case.\n\nExamples:\n\n    (def s \"abc\")\n    (assert (= (length s) 3))         → T\n    (assert (eq? (str-rune s 0) #\\x)) → assertion failed: ..."  builtin? "Return `T` if `v` is a built-in function implemented in C, `NIL`\notherwise.\n\nExamples:\n\n    (builtin? map)         → T\n    (builtin? macroexpand) → NIL"  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).\n\nExamples:\n\n    (def q '(1 2 3 4 5))\n    (set-car! q 0) → (0 6 7)\n    q              → (0 6 7)"  (doc
+  group debug) "Debugging utilities."  1+ "Equivalent to `(+ n 1)` - increment by one."  arr? "Return `T` if the argument is either a vector or an array, `NIL`\notherwise."  vec "Return a vector constructed of the arguments.\n\nExamples:\n\n    (vec)              → #() ; empty vector\n    (vec 1 2.5 \"a\" 'b) → #(1 2.5 \"a\" b)"  positive? "Return `T` if `x` is greater than zero."  *builtins* "VM instructions as closures."  str "Return concatenation of terms formatted as strings.\n\nThis is equivalent to `(princ terms…)`, except the string is\nreturned, rather than printed.\n\nExamples:\n\n    (str \"a\" 'b 1 #(0)) → \"ab1#(0)\""  remprop "Remove a property value associated with the symbol."  negative? "Return `T` if `x` is negative."  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."  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.\n\nExamples:\n\n    (def s \"abc\")\n    (assert-fail (= (length s) 3))   → assertion failed: ...\n    (assert-fail (= s 1) type-error) → T"  (doc
+  group list) "Working with lists."  file "Open a file for I/O.\n\nAn `io` object is returned.  Without any modes specified the file\nis opened in read-only mode."  1- "Equivalent to `(- n 1)` - decrement by one."  cdr "Return the second element of a cons cell (tail of a list) or `NIL` if\nnot available.\n\nExamples:\n\n    (cdr NIL)      → NIL\n    (cdr '(1 2 3)) → (2 3)\n    (cdr '(1 . 2)) → 2"  atom? "Return `T` if `v` is a _not_ a cons cell, `NIL` otherwise.  This is\nthe opposite of `cons?`.\n\nThe term \"atom\" comes from the idea of being indivisible.\n\nExamples:\n\n    (atom? \"a\")  → T\n    (atom? NIL)  → T\n    (atom? '(1)) → NIL"  / "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.\n\nExamples:\n\n    (/ 2)       → 0.5\n    (/ 7 2 2)   → 1.75\n    (/ 10 -2)   → -5 ; a fixnum\n    (/ 6.9 1.9) → 3.6315…"  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.\n\nExamples:\n\n    (equal? 0.0 0) → NIL\n    (equal? 0 0)   → T\n    (def a \"1\")\n    (def b \"1\")\n    (equal? a b)   → T\n    (def a '(1))\n    (def b '(1))\n    (equal? a b)   → T"  apply "Return the result of applying a function to a list of arguments.\n\nThe last argument must always be a list which gets spliced as\narguments to the function.\n\nExamples:\n\n    (apply + 1 2 '(3 4 5))   → 15\n    (apply vec '(1 2 3))     → #(3 4 5)\n    (apply arr 'u8 '(3 4 5)) → #vu8(3 4 5)"  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."  = "Numerical equality test.  Return `T` if all numbers are equal,\n`NIL` otherwise."  rand-u64 "Return a random integer on interval [0, 2⁶⁴-1]."  (doc
+  group sys) "OS-specific functions."  not "Return `T` if `v` is `NIL`, `T` otherwise."  set-cdr! "Modify a cons cell (a list) in-place by putting `new-second` as its\nsecond element (tail of the list).  Return the modified cons\ncell (list).\n\nExamples:\n\n    (def q '(1 2 3 4 5))\n    (set-cdr! q '(6 7)) → (1 6 7)\n    q                   → (1 6 7)"  fn? "Return `T` if `v` is a function, `NIL` otherwise.\n\nExamples:\n\n    (fn? map)         → T\n    (fn? macroexpand) → T"  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 signal the user input is required.\n\nDefault function prints `#;> `."  member "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `equal?`.\n\nExamples:\n\n    (member 1 '(3 2 1 0)) → (1 0)\n    (member 1 '(2 3))     → NIL"  eq? "Return `T` if `a` and `b` are the same object, `NIL` otherwise.\n\nExamples:\n\n    (eq? 0.0 0) → NIL\n    (eq? 0 0)   → T\n    (def a \"1\")\n    (def b \"1\")\n    (eq? a b)   → NIL\n    (def a '(1))\n    (def b '(1))\n    (eq? a b)   → NIL"  getprop "Return a property value associated with the symbol or `def` if\nmissing."  vm-stats "Print various VM-related information, such as the number of GC\ncalls so far, heap and stack size, etc."  * "Return product of the arguments or `1` when none specified."  putprop "Associate a property value with the symbol."  io->str "Return an in-memory `io` buffer converted to a string."  rand-f32 "Return a random 32-bit floating pointer number on [0.0, 1.0] interval."  bound? "Return `T` if `symbol` has a value associated with it, `NIL` otherwise."  (doc
+  group type) "Dealing with types."  odd? "Return `T` if `x` is an odd integer, `NIL` otherwise."  list? "Return `T` if the value is either `NIL` or a cons cell, `NIL`\notherwise."  (doc
+  group io) "I/O functionality."  table? "Return `T` if the argument is a table, `NIL` otherwise."  < "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`."  sym "Return a symbol with the name being the concatenation of terms\nformatted as strings.\n\nThis is equivalent to `(sym (str terms…))`.\n\nExamples:\n\n    (sym \"a\" 'b 1) → ab1"  (doc
   group builtin) "Built-in operators."  NIL "An empty list.  Can be used as the opposite of T in boolean\nexpressions.\n\nExamples:\n\n    (not NIL)         → T\n    (if NIL 'yes 'no) → no\n    (car NIL)         → NIL\n    (cdr NIL)         → NIL"  for "Call the function `fn` with a single integer argument, starting from\n`min` and ending with `max`.\n\nExamples:\n\n    (for 0 2 (λ (i) (print (- 2 i)))) → 210"  (doc
   group vm) "VM-related functions."  assoc "Return a pair of a matching key and the associated value, or `NIL` if\nnone matched.  Keys are compared using `equal?`.\n\nExamples:\n\n    (def L (assoc-list 'a 0 'b 1))\n    (assoc 'b L) → (b . 1)\n    (assoc 'c L) → NIL"  > "Return `T` if the arguments are in strictly decreasing order (previous\none is greater than the next one)."  + "Return sum of the arguments or `0` when none specified."  (doc
-  group rand) "Random numbers generation."  compare "Return -1 if `x` is less than `y`, 0 if equal, and `1` if `y` is\ngreater than `x`.\n\nExamples:\n\n    (compare 'a 'b)   → -1\n    (compare 1 1)     → 0\n    (compare \"b\" \"a\") → 1"  add-exit-hook "Puts an one-argument function on top of the list of exit hooks.\n\nOn shutdown each exit hook is called with the exit status as a single\nargument, which is (usually) `NIL` on success and a string describing\nan error otherwise."  doc-group "Define documentation for a group."  cons? "Return `T` if `v` is a cons cell, `NIL` otherwise.\n\nExamples:\n\n    (cons? 0)    → NIL\n    (cons? NIL)  → NIL\n    (cons? '(1)) → T"  even? "Return `T` if `x` is an even integer, `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.\n\nExamples:\n\n    (def a '((1 #(2 (3)) 4)))\n    (aref a 0)     → (1 (2 (3)) 4)\n    (aref a 1)     → index 1 out of bounds\n    (aref a 0 0)   → 1\n    (aref a 0 1 0) → 2\n    (aref a 0 2)   → 4"  *properties* "All properties of symbols recorded with `putprop` are recorded in this\ntable."  zero? "Return `T` if `x` is zero."  >= "Return `T` if the arguments are in non-increasing order (previous\none is greater than or equal to the next one)."  sym? "Return `T` if `v` is a symbol, `NIL` otherwise."  void? "Return `T` if `x` is `#<void>`, `NIL` otherwise."  proper-list? "Return `T` is the value is a proper list.  That is, a non-circular\nlist with the last element being `NIL`, as opposed to a dotted list.\n\nExamples:\n\n    (proper-list? NIL)     → T\n    (proper-list? '(1))    → T\n    (proper-list? '(1 . 2) → NIL\n    (def l '(1))\n    (set-cdr! l l)         → #0=(1 . #0#)\n    (length l)             → +inf.0\n    (proper-list? l)       → NIL"  length= "Perform a bounded length test.\n\nUse this instead of `(= (length seq) n)`, since it avoids unnecessary\nwork and always terminates."  doc-for "Define documentation for a top level term.\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 and \"see also\"\nreferences.\n\nUseful in cases where setting the documentation for a term can't\n(or not preferred to) be made during the definition of said term.\nOne of those reasons is that the term is a built-in function\nimplemented in C.\n\nExamples:\n\n    (doc-for (func arg (arg2 0))\n      \"Return something about the `arg` and `arg2`.  This is a short\n       description.\n\n       This is the longer description, following the short one.\n\n       Examples:\n\n           (func 0)   → T\n           (func 1 3) → NIL\"\n      :doc-group stuff\n      :doc-see func2)\n    (doc-for (func arg (:another-variant NIL)))"  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.\n\nExamples:\n\n    (def a '((1 #(2 (3)) 4)))\n    (aset! a 1 'x)     → index 1 out of bounds\n    (aset! a 0 0 'x)   → x\n    a                  → ((x #(2 (3)) 4))\n    (aset! a 0 1 9)    → 9\n    a                  → ((x #(9 (3)) 4))"  T "A boolean \"true\".\n\nExamples:\n\n    (not T)         → NIL\n    (if T 'yes 'no) → yes"  car "Return the first element of a cons cell (head of a list) or `NIL` if\nnot available.\n\nExamples:\n\n    (car NIL)      → NIL\n    (car '(1 2 3)) → 1\n    (car '(1 . 2)) → 1"  <= "Return `T` if the arguments are in non-decreasing order (previous\none is less than or equal to the next one)."  cons "Return a cons cell containing two arguments.\n\nExamples:\n\n    (cons 1 2)                     → (1 . 2)\n    (cons 1
\ No newline at end of file
-  group string) "String-related functionality."  vec? "Return `T` if `v` is a vector, `NIL` otherwise."  min "Return the smallest among the arguments.\n\nExamples:\n\n    (min 3 1 9 4)     → 1\n    (min 'c 'h 'z 'a) → a\n    (min \"t\" \"g\" \"a\") → \"a\""  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.\n\nExamples:\n\n    (eqv? 0.0 0) → NIL\n    (eqv? 0 0)   → T\n    (def a \"1\")\n    (def b \"1\")\n    (eqv? a b)   → T\n    (def a '(1))\n    (def b '(1))\n    (eqv? a b)   → NIL"  io? "Return `T` if `term` is of `io` type, `NIL` otherwise."  eof-object? "Return `T` if `term` is `#<eof>`, `NIL` otherwise.\n\nThis object is returned by I/O functions to signal end of file,\nwhere applicable."  list "Return a list constructed of the arguments.\n\nExamples:\n\n    (list)              → NIL ; empty list\n    (list 1 2.5 \"a\" 'b) → (1 2.5 \"a\" b)"  help "Display documentation the specified term, if available.\n\nThe optional parameter `kind` can be set to `group` to show\ndocumentation for the specified group instead of a single term.\nAll available documentation groups can be displayed with `(help\ngroups)`."  memv "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `eqv?`."  (doc
-  group doc) "Writing and reading documentation."  max "Return the largest among the arguments.\n\nExamples:\n\n    (max 3 1 9 4)     → 9\n    (max 'c 'h 'z 'a) → z\n    (max \"t\" \"g\" \"a\") → \"t\""  rand-u32 "Return a random integer on interval [0, 2³²-1]."  rand-f64 "Return a random 64-bit floating point number on interval [0.0, 1.0]."  help-print-header "Format and print signature(s) of the term for `(help term)` output."  arg-counts "VM instructions mapped to their expected arguments count."  (doc
+  group rand) "Random numbers generation."  abs "Return absolute value of the argument."  compare "Return -1 if `x` is less than `y`, 0 if equal, and `1` if `y` is\ngreater than `x`.\n\nExamples:\n\n    (compare 'a 'b)   → -1\n    (compare 1 1)     → 0\n    (compare \"b\" \"a\") → 1"  add-exit-hook "Puts an one-argument function on top of the list of exit hooks.\n\nOn shutdown each exit hook is called with the exit status as a single\nargument, which is (usually) `NIL` on success and a string describing\nan error otherwise."  str? "Return `T` if the argument is a string, `NIL` otherwise."  doc-group "Define documentation for a group."  cons? "Return `T` if `v` is a cons cell, `NIL` otherwise.\n\nExamples:\n\n    (cons? 0)    → NIL\n    (cons? NIL)  → NIL\n    (cons? '(1)) → T"  keyword? "Return `T` if the argument is a keyword, `NIL` otherwise."  even? "Return `T` if `x` is an even integer, `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.\n\nExamples:\n\n    (def a '((1 #(2 (3)) 4)))\n    (aref a 0)     → (1 (2 (3)) 4)\n    (aref a 1)     → index 1 out of bounds\n    (aref a 0 0)   → 1\n    (aref a 0 1 0) → 2\n    (aref a 0 2)   → 4"  *properties* "All properties of symbols recorded with `putprop` are recorded in this\ntable."  zero? "Return `T` if `x` is zero."  >= "Return `T` if the arguments are in non-increasing order (previous\none is greater than or equal to the next one)."  sym? "Return `T` if `v` is a symbol, `NIL` otherwise."  void? "Return `T` if `x` is `#<void>`, `NIL` otherwise."  proper-list? "Return `T` is the value is a proper list.  That is, a non-circular\nlist with the last element being `NIL`, as opposed to a dotted list.\n\nExamples:\n\n    (proper-list? NIL)      → T\n    (proper-list? '(1))     → T\n    (proper-list? '(1 . 2)) → NIL\n    (def l '(1))\n    (set-cdr! l l)          → #0=(1 . #0#)\n    (length l)              → +inf.0\n    (proper-list? l)        → NIL"  length= "Perform a bounded length test.\n\nUse this instead of `(= (length seq) n)`, since it avoids unnecessary\nwork and always terminates."  int? "Return `T` if the argument is an integer, `NIL` otherwise."  random "Return a random number in the range `[0, n]` (inclusive).\n\nThe result is either an integer or a floating point number, depending\non the type of the argument.\n\nExamples:\n\n    (random 1)   → 1\n    (random 1.0) → 0.69517"  doc-for "Define documentation for a top level term.\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 and \"see also\"\nreferences.\n\nUseful in cases where setting the documentation for a term can't\n(or not preferred to) be made during the definition of said term.\nOne of those reasons is that the term is a built-in function\nimplemented in C.\n\nExamples:\n\n    (doc-for (func arg (arg2 0))\n      \"Return something about the `arg` and `arg2`.  This is a short\n       description.\n\n       This is the longer description, following the short one.\n\n       Examples:\n\n           (func 0)   → T\n           (func 1 3) → NIL\"\n      :doc-group stuff\n      :doc-see func2)\n    (doc-for (func arg (:another-variant NIL)))"  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.\n\nExamples:\n\n    (def a '((1 #(2 (3)) 4)))\n    (aset! a 1 'x)     → index 1 out of bounds\n    (aset! a 0 0 'x)   → x\n    a                  → ((x #(2 (3)) 4))\n    (aset! a 0 1 9)    → 9\n    a                  → ((x #(9 (3)) 4))"  T "A boolean \"true\".\n\nExamples
\ No newline at end of file
+  group string) "String-related functionality."  vec? "Return `T` if `v` is a vector, `NIL` otherwise."  min "Return the smallest among the arguments.\n\nExamples:\n\n    (min 3 1 9 4)     → 1\n    (min 'c 'h 'z 'a) → a\n    (min \"t\" \"g\" \"a\") → \"a\""  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.\n\nExamples:\n\n    (eqv? 0.0 0) → NIL\n    (eqv? 0 0)   → T\n    (def a \"1\")\n    (def b \"1\")\n    (eqv? a b)   → T\n    (def a '(1))\n    (def b '(1))\n    (eqv? a b)   → NIL"  io? "Return `T` if `term` is of `io` type, `NIL` otherwise."  eof-object? "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."  list "Return a list constructed of the arguments.\n\nExamples:\n\n    (list)              → NIL ; empty list\n    (list 1 2.5 \"a\" 'b) → (1 2.5 \"a\" b)"  help "Display documentation the specified term, if available.\n\nThe optional parameter `kind` can be set to `group` to show\ndocumentation for the specified group instead of a single term.\nAll available documentation groups can be displayed with `(help\ngroups)`."  memv "Return the tail of a list beginning with the item, or `NIL` otherwise.\nList elements are compared to the `item` using `eqv?`."  (doc
+  group doc) "Writing and reading documentation."  max "Return the largest among the arguments.\n\nExamples:\n\n    (max 3 1 9 4)     → 9\n    (max 'c 'h 'z 'a) → z\n    (max \"t\" \"g\" \"a\") → \"t\""  rand-u32 "Return a random integer on interval [0, 2³²-1]."  closure? "Return `T` if the argument is a function that is implemented in LISP\n(as opposed to a C builtin), `NIL` otherwise.\n\nExamples:\n\n    (closure? closure?) → T\n    (closure? length)   → NIL"  rand-f64 "Return a random 64-bit floating point number on interval [0.0, 1.0]."  help-print-header "Format and print signature(s) of the term for `(help term)` output."  arg-counts "VM instructions mapped to their expected arguments count."  rune? "Return `T` if the value is a rune, `NIL` otherwise."  (doc
 iting and reading documentation."  max "Return the largest among the arguments.\n\nExamples:\n\n    (max 3 1 9 4)     → 9\n    (max 'c 'h 'z 'a) → z\n    (max \"t\" \"g\" \"a\") → \"t\""  rand-u32 "Return a random integer on interval [0, 2³²-1]."  rand-f64 "Return a random 64-bit floating point number on interval [0.0, 1.0]."  help-print-header "Format and print signature(s) of the term for `(help term)` output."  arg-counts "VM instructions mapped to their expected arguments count."  (doc
-turn a random integer on interval [0, 2³²-1]."  rand-f64 "Return a random 64-bit floating point number on interval [0.0, 1.0]."  help-print-header "Format and print signature(s) of the term for `(help term)` output."  arg-counts "VM instructions mapped to their expected arguments count."  (doc
-  group compress) "Compression."  identity "Return `x`.")  *doc-extra* #table(rand-f32 ((:doc-group . rand))  bound? ((:doc-group . builtin))  sym-set-doc ((:doc-group . doc))  odd? ((:doc-group . compare)
-  (:doc-see . even?))  list? ((:doc-group . list) (:doc-see . proper-list?))  io-eof? ((:doc-group . io))  < ((:doc-group . compare)
-  (:doc-group . builtin))  cadr ((:doc-group . list) (:doc-group . builtin))  nan? ((:doc-group . builtin))  NIL ((:doc-see . T))  for ((:doc-group . builtin))  fixnum? ((:doc-group . builtin))  exit ((:doc-group . sys))  assoc ((:doc-group . list)
-  (:doc-see . assv))  > ((:doc-group . compare))  + ((:doc-group . builtin))  div0 ((:doc-group . builtin))  lz-unpack ((:doc-group . compress))  compare ((:doc-group . builtin))  buffer ((:doc-group . io))  num? ((:doc-group . builtin))  assert ((:doc-group . debug)
-  (:doc-see . assert-fail))  builtin? ((:doc-group . builtin))  set-car! ((:doc-group . list) (:doc-group . builtin))  doc-group ((:doc-group . doc))  cons? ((:doc-group . builtin))  even? ((:doc-group . compare)
+doc
+  group doc) "Writing and reading documentation."  max "Return the largest among the arguments.\n\nExamples:\n\n    (max 3 1 9 4)     → 9\n    (max 'c 'h 'z 'a) → z\n    (max \"t\" \"g\" \"a\") → \"t\""  rand-u32 "Return a random integer on interval [0, 2³²-1]."  closure? "Return `T` if the argument is a function that is implemented in LISP\n(as opposed to a C builtin), `NIL` otherwise.\n\nExamples:\n\n    (closure? closure?) → T\n    (closure? length)   → NIL"  rand-f64 "Return a random 64-bit floating point number on interval [0.0, 1.0]."  help-print-header "Format and print signature(s) of the term for `(help term)` output."  arg-counts "VM instructions mapped to their expected arguments count."  rune? "Return `T` if the value is a rune, `NIL` otherwise."  (doc
+  group compress) "Compression."  identity "Return `x`.")  *doc-extra* #table(rand-f32 ((:doc-group . rand))  bound? ((:doc-group . builtin))  sym-set-doc ((:doc-group . doc))  odd? ((:doc-group . compare)
+  (:doc-see . even?))  list? ((:doc-group . list) (:doc-group . type) (:doc-see . proper-list?))  io-eof? ((:doc-group . io))  table? ((:doc-group . type))  < ((:doc-group . compare)
+  (:doc-group . builtin))  cadr ((:doc-group . list) (:doc-group . builtin))  nan? ((:doc-group . builtin))  NIL ((:doc-see . T))  ptr? ((:doc-group . type))  for ((:doc-group . builtin))  fixnum? ((:doc-group . type)
+  (:doc-group . builtin))  exit ((:doc-group . sys))  assoc ((:doc-group . list) (:doc-see . assv))  > ((:doc-group . compare))  + ((:doc-group . builtin))  div0 ((:doc-group . builtin))  lz-unpack ((:doc-group . compress))  compare ((:doc-group . builtin))  buffer ((:doc-group . io))  num? ((:doc-group . type)
+  (:doc-group . builtin))  gensym? ((:doc-group . type))  assert ((:doc-group . debug) (:doc-see . assert-fail))  str? ((:doc-group . type))  builtin? ((:doc-group . type)
+  (:doc-group . builtin))  set-car! ((:doc-group . list) (:doc-group . builtin))  doc-group ((:doc-group . doc))  cons? ((:doc-group . type)
+  (:doc-group . builtin))  keyword? ((:doc-group . type))  arr? ((:doc-group . type))  even? ((:doc-group . compare)
  . builtin))  even? ((:doc-group . compare)
   (:doc-see . odd?))  aref ((:doc-group . builtin))  *properties* ((:doc-group . prop))  vec ((:doc-group . builtin))  >= ((:doc-group . compare))  sym? ((:doc-group . builtin))  zero? ((:doc-group . compare))  proper-list? ((:doc-group . list)
   (:doc-see . list?))  length= ((:doc-group . list) (:doc-see . length>))  positive? ((:doc-group . compare))  doc-for ((:doc-group . doc))  aset! ((:doc-group . builtin))  T ((:doc-see))  car ((:doc-group . list)
-p . builtin))  T ((:doc-see))  car ((:doc-group . list)
-  (:doc-group . builtin))  *builtins* ((:doc-group . builtin))  str ((:doc-group . string))  cons ((:doc-group . list)
-  (:doc-group . builtin))  - ((:doc-group . builtin))  remprop ((:doc-group . prop))  <= ((:doc-group . compare))  rand ((:doc-group . rand))  negative? ((:doc-group . compare))  assert-fail ((:doc-group . debug)
+doc-group . compare)
+  (:doc-see . odd?))  aref ((:doc-group . builtin))  *properties* ((:doc-group . prop))  vec ((:doc-group . builtin))  >= ((:doc-group . compare))  sym? ((:doc-group . type)
+  (:doc-group . builtin))  zero? ((:doc-group . compare))  proper-list? ((:doc-group . list) (:doc-group . type)
+  (:doc-see . list?))  length= ((:doc-group . list) (:doc-see . length>))  int? ((:doc-group . type))  positive? ((:doc-group . compare))  doc-for ((:doc-group . doc))  aset! ((:doc-group . builtin))  T ((:doc-see))  car ((:doc-group . list)
+  (:doc-group . builtin))  *builtins* ((:doc-group . builtin))  str ((:doc-group . string))  cons ((:doc-group . list)
+  (:doc-group . builtin))  - ((:doc-group . builtin))  remprop ((:doc-group . prop))  <= ((:doc-group . compare))  rand ((:doc-group . rand))  negative? ((:doc-group . compare))  assert-fail ((:doc-group . debug)
 list) (:doc-group . builtin))  vec? ((:doc-group . builtin))  / ((:doc-group . builtin))  equal? ((:doc-group . compare)
   (:doc-group . builtin))  min ((:doc-group . compare) (:doc-see . max))  eqv? ((:doc-group . compare)
-           (:doc-group . builtin))  io? ((:doc-group . io))  eof-object? ((:doc-group . io))  list ((:doc-group . builtin))  apply ((:doc-group . builtin))  help ((:doc-group . doc))  memv ((:doc-group . list)
+up . list) (:doc-group . builtin))  atom? ((:doc-group . type)
+                                                                                (:doc-group . builtin))  vec? ((:doc-group . type)
 r))  max ((:doc-group . compare) (:doc-see . min))  rand-u32 ((:doc-group . rand))  = ((:doc-group . compare)
-pare)
-  (:doc-group . builtin))  rand-u64 ((:doc-group . rand))  not ((:doc-group . builtin))  separate-doc-from-body ((:doc-group . doc))  set-cdr! ((:doc-group . list)
+                            (:doc-group . type))  eof-object? ((:doc-group . io)
+  (:doc-group . type))  list ((:doc-group . builtin))  apply ((:doc-group . builtin))  help ((:doc-group . doc))  memv ((:doc-group . list)
 . rand))  lz-pack ((:doc-group . compress))  arg-counts ((:doc-group . builtin))  help-print-header ((:doc-group . doc))  eq? ((:doc-group . compare)
   (:doc-group . builtin))  member ((:doc-group . list) (:doc-see . memv))  getprop ((:doc-group . prop)
                                                                                     (:doc-see . putprop))  putprop ((:doc-group . prop)
--- a/src/docs.sl
+++ b/src/docs.sl
@@ -134,7 +134,8 @@
 
 (doc-for (io? term)
   "Return `T` if `term` is of `io` type, `NIL` otherwise."
-  :doc-group io)
+  :doc-group io
+  :doc-group type)
 
 (doc-for (io->str io)
   "Return an in-memory `io` buffer converted to a string."
@@ -145,12 +146,13 @@
    otherwise.»
   :doc-group io)
 
-(doc-for (eof-object? term)
-  "Return `T` if `term` is `#<eof>`, `NIL` otherwise.
+(doc-for (eof-object? v)
+  "Return `T` if the argument is `#<eof>`, `NIL` otherwise.
 
    This object is returned by I/O functions to signal end of file,
    where applicable."
-  :doc-group io)
+  :doc-group io
+  :doc-group type)
 
 (doc-for (buffer)
   "Return an in-memory buffer for I/O, of `io` type.
@@ -266,3 +268,27 @@
        (defstruct blah :predicate blargh? a b c)
        ; without predicate
        (defstruct blah :predicate NIL a b c)»)
+
+(doc-for (int? v)
+  "Return `T` if the argument is an integer, `NIL` otherwise."
+  :doc-group type)
+
+(doc-for (str? v)
+  "Return `T` if the argument is a string, `NIL` otherwise."
+  :doc-group type)
+
+(doc-for (gensym? v)
+  "Return `T` if the argument is a gensym, `NIL` otherwise."
+  :doc-group type)
+
+(doc-for (ptr? v)
+  "Return `T` if the argument is an abstract pointer, `NIL` otherwise."
+  :doc-group type)
+
+(doc-for (table? v)
+  "Return `T` if the argument is a table, `NIL` otherwise."
+  :doc-group type)
+
+(doc-for (keyword? v)
+  "Return `T` if the argument is a keyword, `NIL` otherwise."
+  :doc-group type)
--- a/src/system.sl
+++ b/src/system.sl
@@ -414,11 +414,11 @@
   x)
 
 (def (1+ n)
-  "Equivalent to `(+ n 1)`."
+  "Equivalent to `(+ n 1)` - increment by one."
   (+ n 1))
 
 (def (1- n)
-  "Equivalent to `(- n 1)`."
+  "Equivalent to `(- n 1)` - decrement by one."
   (- n 1))
 
 (def (div x y)
@@ -435,11 +435,21 @@
   (- x (* (div x y) y)))
 
 (def (random n)
+  "Return a random number in the range `[0, n]` (inclusive).
+
+   The result is either an integer or a floating point number, depending
+   on the type of the argument.
+
+   Examples:
+
+       (random 1)   → 1
+       (random 1.0) → 0.69517"
   (if (int? n)
       (mod (rand) n)
       (* (rand-f64) n)))
 
 (def (abs x)
+  "Return absolute value of the argument."
   (if (< x 0)
       (- x)
       x))
@@ -476,18 +486,35 @@
              xs)
       x0))
 
-(def (rune? x)
-  (eq? (type-of x) 'rune))
+(doc-group type
+  "Dealing with types.")
 
-(def (arr? x)
-  (or (vec? x)
-      (let ((tx (type-of x)))
+(def (rune? v)
+  "Return `T` if the value is a rune, `NIL` otherwise."
+  :doc-group type
+  (eq? (type-of v) 'rune))
+
+(def (arr? v)
+  "Return `T` if the argument is either a vector or an array, `NIL`
+   otherwise."
+  :doc-group type
+  (or (vec? v)
+      (let ((tx (type-of v)))
         (and (cons? tx) (eq? (car tx) 'arr)))))
 
-(def (closure? x)
-  (and (fn? x)
-       (not (builtin? x))))
+(def (closure? v)
+  "Return `T` if the argument is a function that is implemented in LISP
+   (as opposed to a C builtin), `NIL` otherwise.
 
+   Examples:
+
+       (closure? closure?) → T
+       (closure? length)   → NIL"
+  :doc-group type
+  :doc-see fn?
+  (and (fn? v)
+       (not (builtin? v))))
+
 (def (caar x) (car (car x)))
 (def (cdar x) (cdr (car x)))
 (def (cddr x) (cdr (cdr x)))
@@ -541,27 +568,29 @@
        (or (pred (car lst))
            (any pred (cdr lst)))))
 
-(def (list? a)
+(def (list? v)
   "Return `T` if the value is either `NIL` or a cons cell, `NIL`
    otherwise."
   :doc-group list
+  :doc-group type
   :doc-see proper-list?
-  (or (not a) (cons? a)))
+  (or (not v) (cons? v)))
 
-(def (proper-list? a)
+(def (proper-list? v)
   "Return `T` is the value is a proper list.  That is, a non-circular
    list with the last element being `NIL`, as opposed to a dotted list.
 
    Examples:
 
-       (proper-list? NIL)     → T
-       (proper-list? '(1))    → T
-       (proper-list? '(1 . 2) → NIL
+       (proper-list? NIL)      → T
+       (proper-list? '(1))     → T
+       (proper-list? '(1 . 2)) → NIL
        (def l '(1))
-       (set-cdr! l l)         → #0=(1 . #0#)
-       (length l)             → +inf.0
-       (proper-list? l)       → NIL"
+       (set-cdr! l l)          → #0=(1 . #0#)
+       (length l)              → +inf.0
+       (proper-list? l)        → NIL"
   :doc-group list
+  :doc-group type
   :doc-see list?
   (def (proper? a b)
     (let* {[a (cdr a)]
@@ -570,7 +599,7 @@
       (if (and (cons? a) (cons? b) (not (eq? a b)))
           (proper? a b)
           (and (or (not a) (cons? a)) (not b)))))
-  (or (not a) (and (cons? a) (proper? a a))))
+  (or (not v) (and (cons? v) (proper? v v))))
 
 (def (list-tail lst n)
   (if (<= n 0)
--- a/tools/gen.sl
+++ b/tools/gen.sl
@@ -70,7 +70,8 @@
 
            (cons? 0)    → NIL
            (cons? NIL)  → NIL
-           (cons? '(1)) → T"]})
+           (cons? '(1)) → T"
+      :doc-group type]})
   (op brne)
   (op loadt)
   (op load0)
@@ -77,7 +78,7 @@
   (op loadc1)
   (op aref2)
   (op atom? 1 (λ (x) (atom? x))
-    {[(value)
+    {[(v)
       «Return `T` if `v` is a _not_ a cons cell, `NIL` otherwise.  This is
        the opposite of `cons?`.
 
@@ -87,7 +88,8 @@
 
            (atom? "a")  → T
            (atom? NIL)  → T
-           (atom? '(1)) → NIL»]})
+           (atom? '(1)) → NIL»
+      :doc-group type]})
   (op loadvoid)
   (op brnn)
   (op load1)
@@ -139,7 +141,8 @@
       :doc-group compare]})
   (op sym? 1 (λ (x) (sym? x))
     {[(v)
-      "Return `T` if `v` is a symbol, `NIL` otherwise."]})
+      "Return `T` if `v` is a symbol, `NIL` otherwise."
+      :doc-group type]})
   (op not 1 (λ (x) (not x))
     {[(v)
       "Return `T` if `v` is `NIL`, `T` otherwise."]})
@@ -166,10 +169,12 @@
 
        Numerical types include floating point, fixnum, bignum, etc.
        Note: ironically, a NaN value is considered a number by this function
-       since it's only testing the _type_ of the value."]})
+       since it's only testing the _type_ of the value."
+      :doc-group type]})
   (op fixnum? 1 (λ (x) (fixnum? x))
     {[(v)
-      "Return `T` if `v` is of a fixnum type, `NIL` otherwise."]})
+      "Return `T` if `v` is of a fixnum type, `NIL` otherwise."
+      :doc-group type]})
   (op bound? 1 (λ (x) (bound? x))
     {[(symbol)
       "Return `T` if `symbol` has a value associated with it, `NIL` otherwise."]})
@@ -181,7 +186,8 @@
        Examples:
 
            (builtin? map)         → T
-           (builtin? macroexpand) → NIL"]})
+           (builtin? macroexpand) → NIL"
+      :doc-group type]})
   (op fn? 1 (λ (x) (fn? x))
     {[(v)
       "Return `T` if `v` is a function, `NIL` otherwise.
@@ -189,10 +195,12 @@
        Examples:
 
            (fn? map)         → T
-           (fn? macroexpand) → T"]})
+           (fn? macroexpand) → T"
+      :doc-group type]})
   (op vec? 1 (λ (x) (vec? x))
     {[(v)
-      "Return `T` if `v` is a vector, `NIL` otherwise."]})
+      "Return `T` if `v` is a vector, `NIL` otherwise."
+      :doc-group type]})
   (op shift)
   (op set-car! 2 (λ (x y) (set-car! x y))
     {[(cell new-first)