ref: 20614653e930f3c614732505de6ee8da0acae447
parent: d2e8d70b5ba0ac809041cde11a106e4a7d641670
author: spew <spew@cbza.org>
date: Sun Mar 23 16:57:16 EDT 2025
system.sl: add find-if, fix find, lsd: add sym-local
--- a/boot/sl.boot
+++ b/boot/sl.boot
@@ -36,10 +36,10 @@
→ ((x #(2 (3)) 4))\n (aset! a 0 1 9) → 9\n a → ((x #(9 (3)) 4))" 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" *builtins* "VM instructions as closures." str "Convert terms to a concatenated string.\n\nThis is equivalent to `(princ terms…)`, except the string is\nreturned, rather than printed." cons "Return a cons cell containing two arguments.\n\nExamples:\n\n (cons 1 2) → (1 . 2)\n (cons 1 '(2)) → (1 2)\n (cons 1 (cons 2 (cons 3 NIL))) → (1 2 3)" - "Return the result of subtraction. With only one argument a\nnegation is performed.\n\nExamples:\n\n (- 1.5) → -1.5\n (- 3 2) → 1" remprop "Remove a property value associated with the symbol." <= "Return `T` if the arguments are in non-decreasing order (previous\none is less than or equal to the next one)." 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." negative? "Return `T` if `x` is negative." Instructions "VM instructions mapped to their encoded byte representation." 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" T "A boolean \"true\".\n\nExamples:\n\n (not T) → NIL\n (if T 'yes 'no) → yes" vec? "Return `T` if `v` is a vector, `NIL` otherwise." 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" / "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…" 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)" 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)" help "Display documentation for the specified term, if available." separate-doc-from-body "Take a list of terms and return a pair `(doc . body)`, where
\ No newline at end of file
props) vec ((:doc-group . builtin)) >= ((:doc-group . compare)) sym? ((:doc-group . builtin)) zero? ((:doc-group . compare)) length= ((:doc-group . list)) positive? ((:doc-group . compare)) doc-for ((:doc-group . docs)) aset! ((:doc-group . builtin)) car ((:doc-group . builtin)) *builtins* ((:doc-group . builtin)) str ((:doc-see . T)) cons ((:doc-group . builtin)) - ((:doc-group . builtin)) remprop ((:doc-group . props)) <= ((:doc-group . compare)) negative? ((:doc-group . compare)) Instructions ((:doc-group . builtin)) file ((:doc-group . io)) cdr ((:doc-group . builtin)) atom? ((:doc-group . builtin)) T ((:doc-see)) vec? ((:doc-group . builtin)) equal? ((:doc-group . builtin)) / ((:doc-group . builtin)) eqv? ((:doc-group . builtin)) io? ((:doc-group . io)) eof-object? ((:doc-group . io)) list ((:doc-group . builtin)) apply ((:doc-group . builtin)) help ((:doc-group . docs)) separate-doc-from-body ((:doc-group . docs)) = ((:doc-group . builtin)) not ((:doc-group . builtin)) set-cdr! ((:doc-group . builtin)) fn? ((:doc-group . builtin)) help-print-header ((:doc-group . docs)) arg-counts ((:doc-group . builtin)) eq? ((:doc-group . builtin)) getprop ((:doc-group . props)) putprop ((:doc-group . props)) * ((:doc-group . builtin)) io->str ((:doc-group . io))))
*syntax-environment* #table(bcode:nconst #fn("n1200r2e3:" #(aref)) doc-for #fn("z10B86;35040<;J404086;35040=70151<863I0212287e22289e22288e2e4:212287e22289e2e3:" #(separate-doc-from-body
-his is equivalent to `(princ terms…)`, except the string is\nreturned, rather than printed." cons "Return a cons cell containing two arguments.\n\nExamples:\n\n (cons 1 2) → (1 . 2)\n (cons 1 '(2)) → (1 2)\n (cons 1 (cons 2 (cons 3 NIL))) → (1 2 3)" - "Return the result of subtraction. With only one argument a\nnegation is performed.\n\nExamples:\n\n (- 1.5) → -1.5\n (- 3 2) → 1" remprop "Remove a property value associated with the symbol." <= "Return `T` if the arguments are in non-decreasing order (previous\none is less than or equal to the next one)." 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." negative? "Return `T` if `x` is negative." Instructions "VM instructions mapped to their encoded byte representation." 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" T "A boolean \"true\".\n\nExamples:\n\n (not T) → NIL\n (if T 'yes 'no) → yes" vec? "Return `T` if `v` is a vector, `NIL` otherwise." 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" / "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…" 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)" 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)" help "Display documentation for the specified term, if available." 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." 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 th
\ No newline at end of file
+his is equivalent to `(princ terms…)`, except the string is\nreturned, rather than printed." cons "Return a cons cell containing two arguments.\n\nExamples:\n\n (cons 1 2) → (1 . 2)\n (cons 1 '(2)) → (1 2)\n (cons 1 (cons 2 (cons 3 NIL))) → (1 2 3)" - "Return the result of subtraction. With only one argument a\nnegation is performed.\n\nExamples:\n\n (- 1.5) → -1.5\n (- 3 2) → 1" remprop "Remove a property value associated with the symbol." <= "Return `T` if the arguments are in non-decreasing order (previous\none is less than or equal to the next one)." 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." negative? "Return `T` if `x` is negative." Instructions "VM instructions mapped to their encoded byte representation." 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" T "A boolean \"true\".\n\nExamples:\n\n (not T) → NIL\n (if T 'yes 'no) → yes" vec? "Return `T` if `v` is a vector, `NIL` otherwise." 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" / "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…" 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)" 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)" help "Display documentation for the specified term, if available." 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." 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 th
\ No newline at end of file
guments.\n\nExamples:\n\n (cons 1 2) → (1 . 2)\n (cons 1 '(2)) → (1 2)\n (cons 1 (cons 2 (cons 3 NIL))) → (1 2 3)" - "Return the result of subtraction. With only one argument a\nnegation is performed.\n\nExamples:\n\n (- 1.5) → -1.5\n (- 3 2) → 1" remprop "Remove a property value associated with the symbol." <= "Return `T` if the arguments are in non-decreasing order (previous\none is less than or equal to the next one)." 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." negative? "Return `T` if `x` is negative." Instructions "VM instructions mapped to their encoded byte representation." 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" T "A boolean \"true\".\n\nExamples:\n\n (not T) → NIL\n (if T 'yes 'no) → yes" vec? "Return `T` if `v` is a vector, `NIL` otherwise." 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" / "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…" 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)" 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)" help "Display documentation for the specified term, if available." 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." 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 → (
\ No newline at end of file
props) vec ((:doc-group . builtin)) >= ((:doc-group . compare)) sym? ((:doc-group . builtin)) zero? ((:doc-group . compare)) length= ((:doc-group . list)) positive? ((:doc-group . compare)) doc-for ((:doc-group . docs)) aset! ((:doc-group . builtin)) car ((:doc-group . builtin)) *builtins* ((:doc-group . builtin)) str ((:doc-see . T)) cons ((:doc-group . builtin)) - ((:doc-group . builtin)) remprop ((:doc-group . props)) <= ((:doc-group . compare)) negative? ((:doc-group . compare)) Instructions ((:doc-group . builtin)) file ((:doc-group . io)) cdr ((:doc-group . builtin)) atom? ((:doc-group . builtin)) T ((:doc-see)) vec? ((:doc-group . builtin)) equal? ((:doc-group . builtin)) / ((:doc-group . builtin)) eqv? ((:doc-group . builtin)) io? ((:doc-group . io)) eof-object? ((:doc-group . io)) list ((:doc-group . builtin)) apply ((:doc-group . builtin)) help ((:doc-group . docs)) separate-doc-from-body ((:doc-group . docs)) = ((:doc-group . builtin)) not ((:doc-group . builtin)) set-cdr! ((:doc-group . builtin)) fn? ((:doc-group . builtin)) help-print-header ((:doc-group . docs)) arg-counts ((:doc-group . builtin)) eq? ((:doc-group . builtin)) getprop ((:doc-group . props)) putprop ((:doc-group . props)) * ((:doc-group . builtin)) io->str ((:doc-group . io))))
-e in non-decreasing order (previous\none is less than or equal to the next one)." 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." negative? "Return `T` if `x` is negative." Instructions "VM instructions mapped to their encoded byte representation." 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" T "A boolean \"true\".\n\nExamples:\n\n (not T) → NIL\n (if T 'yes 'no) → yes" vec? "Return `T` if `v` is a vector, `NIL` otherwise." 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" / "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…" 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)" 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)" help "Display documentation for the specified term, if available." 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." 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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." e
\ No newline at end of file
+e in non-decreasing order (previous\none is less than or equal to the next one)." 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." negative? "Return `T` if `x` is negative." Instructions "VM instructions mapped to their encoded byte representation." 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" T "A boolean \"true\".\n\nExamples:\n\n (not T) → NIL\n (if T 'yes 'no) → yes" vec? "Return `T` if `v` is a vector, `NIL` otherwise." 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" / "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…" 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)" 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)" help "Display documentation for the specified term, if available." 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." 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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." e
\ No newline at end of file
\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." negative? "Return `T` if `x` is negative." Instructions "VM instructions mapped to their encoded byte representation." 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" T "A boolean \"true\".\n\nExamples:\n\n (not T) → NIL\n (if T 'yes 'no) → yes" vec? "Return `T` if `v` is a vector, `NIL` otherwise." 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" / "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…" 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)" 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)" help "Display documentation for the specified term, if available." 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." 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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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\"
\ No newline at end of file
props) vec ((:doc-group . builtin)) >= ((:doc-group . compare)) sym? ((:doc-group . builtin)) zero? ((:doc-group . compare)) length= ((:doc-group . list)) positive? ((:doc-group . compare)) doc-for ((:doc-group . docs)) aset! ((:doc-group . builtin)) car ((:doc-group . builtin)) *builtins* ((:doc-group . builtin)) str ((:doc-see . T)) cons ((:doc-group . builtin)) - ((:doc-group . builtin)) remprop ((:doc-group . props)) <= ((:doc-group . compare)) negative? ((:doc-group . compare)) Instructions ((:doc-group . builtin)) file ((:doc-group . io)) cdr ((:doc-group . builtin)) atom? ((:doc-group . builtin)) T ((:doc-see)) vec? ((:doc-group . builtin)) equal? ((:doc-group . builtin)) / ((:doc-group . builtin)) eqv? ((:doc-group . builtin)) io? ((:doc-group . io)) eof-object? ((:doc-group . io)) list ((:doc-group . builtin)) apply ((:doc-group . builtin)) help ((:doc-group . docs)) separate-doc-from-body ((:doc-group . docs)) = ((:doc-group . builtin)) not ((:doc-group . builtin)) set-cdr! ((:doc-group . builtin)) fn? ((:doc-group . builtin)) help-print-header ((:doc-group . docs)) arg-counts ((:doc-group . builtin)) eq? ((:doc-group . builtin)) getprop ((:doc-group . props)) putprop ((:doc-group . props)) * ((:doc-group . builtin)) io->str ((:doc-group . io))))
*syntax-environment* #table(bcode:nconst #fn("n1200r2e3:" #(aref)) doc-for #fn("z10B86;35040<;J404086;35040=70151<863I0212287e22289e22288e2e4:212287e22289e2e3:" #(separate-doc-from-body
@@ -59,7 +59,7 @@
cable." 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)" 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)" help "Display documentation for the specified term, if available." 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." 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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
props) vec ((:doc-group . builtin)) >= ((:doc-group . compare)) sym? ((:doc-group . builtin)) zero? ((:doc-group . compare)) length= ((:doc-group . list)) positive? ((:doc-group . compare)) doc-for ((:doc-group . docs)) aset! ((:doc-group . builtin)) car ((:doc-group . builtin)) *builtins* ((:doc-group . builtin)) str ((:doc-see . T)) cons ((:doc-group . builtin)) - ((:doc-group . builtin)) remprop ((:doc-group . props)) <= ((:doc-group . compare)) negative? ((:doc-group . compare)) Instructions ((:doc-group . builtin)) file ((:doc-group . io)) cdr ((:doc-group . builtin)) atom? ((:doc-group . builtin)) T ((:doc-see)) vec? ((:doc-group . builtin)) equal? ((:doc-group . builtin)) / ((:doc-group . builtin)) eqv? ((:doc-group . builtin)) io? ((:doc-group . io)) eof-object? ((:doc-group . io)) list ((:doc-group . builtin)) apply ((:doc-group . builtin)) help ((:doc-group . docs)) separate-doc-from-body ((:doc-group . docs)) = ((:doc-group . builtin)) not ((:doc-group . builtin)) set-cdr! ((:doc-group . builtin)) fn? ((:doc-group . builtin)) help-print-header ((:doc-group . docs)) arg-counts ((:doc-group . builtin)) eq? ((:doc-group . builtin)) getprop ((:doc-group . props)) putprop ((:doc-group . props)) * ((:doc-group . builtin)) io->str ((:doc-group . io))))
*syntax-environment* #table(bcode:nconst #fn("n1200r2e3:" #(aref)) doc-for #fn("z10B86;35040<;J404086;35040=70151<863I0212287e22289e22288e2e4:212287e22289e2e3:" #(separate-doc-from-body
-5)) → 15\n (apply vec '(1 2 3)) → #(3 4 5)\n (apply arr 'u8 '(3 4 5)) → #vu8(3 4 5)" help "Display documentation for the specified term, if available." 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." 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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
+5)) → 15\n (apply vec '(1 2 3)) → #(3 4 5)\n (apply arr 'u8 '(3 4 5)) → #vu8(3 4 5)" help "Display documentation for the specified term, if available." 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." 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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
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." 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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
props) vec ((:doc-group . builtin)) >= ((:doc-group . compare)) sym? ((:doc-group . builtin)) zero? ((:doc-group . compare)) length= ((:doc-group . list)) positive? ((:doc-group . compare)) doc-for ((:doc-group . docs)) aset! ((:doc-group . builtin)) car ((:doc-group . builtin)) *builtins* ((:doc-group . builtin)) str ((:doc-see . T)) cons ((:doc-group . builtin)) - ((:doc-group . builtin)) remprop ((:doc-group . props)) <= ((:doc-group . compare)) negative? ((:doc-group . compare)) Instructions ((:doc-group . builtin)) file ((:doc-group . io)) cdr ((:doc-group . builtin)) atom? ((:doc-group . builtin)) T ((:doc-see)) vec? ((:doc-group . builtin)) equal? ((:doc-group . builtin)) / ((:doc-group . builtin)) eqv? ((:doc-group . builtin)) io? ((:doc-group . io)) eof-object? ((:doc-group . io)) list ((:doc-group . builtin)) apply ((:doc-group . builtin)) help ((:doc-group . docs)) separate-doc-from-body ((:doc-group . docs)) = ((:doc-group . builtin)) not ((:doc-group . builtin)) set-cdr! ((:doc-group . builtin)) fn? ((:doc-group . builtin)) help-print-header ((:doc-group . docs)) arg-counts ((:doc-group . builtin)) eq? ((:doc-group . builtin)) getprop ((:doc-group . props)) putprop ((:doc-group . props)) * ((:doc-group . builtin)) io->str ((:doc-group . io))))
*syntax-environment* #table(bcode:nconst #fn("n1200r2e3:" #(aref)) doc-for #fn("z10B86;35040<;J404086;35040=70151<863I0212287e22289e22288e2e4:212287e22289e2e3:" #(separate-doc-from-body
@@ -68,7 +68,7 @@
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" 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." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
props) vec ((:doc-group . builtin)) >= ((:doc-group . compare)) sym? ((:doc-group . builtin)) zero? ((:doc-group . compare)) length= ((:doc-group . list)) positive? ((:doc-group . compare)) doc-for ((:doc-group . docs)) aset! ((:doc-group . builtin)) car ((:doc-group . builtin)) *builtins* ((:doc-group . builtin)) str ((:doc-see . T)) cons ((:doc-group . builtin)) - ((:doc-group . builtin)) remprop ((:doc-group . props)) <= ((:doc-group . compare)) negative? ((:doc-group . compare)) Instructions ((:doc-group . builtin)) file ((:doc-group . io)) cdr ((:doc-group . builtin)) atom? ((:doc-group . builtin)) T ((:doc-see)) vec? ((:doc-group . builtin)) equal? ((:doc-group . builtin)) / ((:doc-group . builtin)) eqv? ((:doc-group . builtin)) io? ((:doc-group . io)) eof-object? ((:doc-group . io)) list ((:doc-group . builtin)) apply ((:doc-group . builtin)) help ((:doc-group . docs)) separate-doc-from-body ((:doc-group . docs)) = ((:doc-group . builtin)) not ((:doc-group . builtin)) set-cdr! ((:doc-group . builtin)) fn? ((:doc-group . builtin)) help-print-header ((:doc-group . docs)) arg-counts ((:doc-group . builtin)) eq? ((:doc-group . builtin)) getprop ((:doc-group . props)) putprop ((:doc-group . props)) * ((:doc-group . builtin)) io->str ((:doc-group . io))))
*syntax-environment* #table(bcode:nconst #fn("n1200r2e3:" #(aref)) doc-for #fn("z10B86;35040<;J404086;35040=70151<863I0212287e22289e22288e2e4:212287e22289e2e3:" #(separate-doc-from-body
- arguments count." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
+ arguments count." *prompt* "Function called by REPL to signal the user input is required.\n\nDefault function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
function prints `#;> `." 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." putprop "Associate a property value with the symbol." * "Return product of the arguments or `1` when none specified." io->str "Return an in-memory `io` buffer converted to a string.") *doc-extra* #table(bound? ((:doc-group . builtin)) sym-set-doc ((:doc-group . docs)) io-eof? ((:doc-group . io)) < ((:doc-group . builtin)) cadr ((:doc-group . builtin)) nan? ((:doc-group . builtin)) for ((:doc-group . builtin)) fixnum? ((:doc-group . builtin)) > ((:doc-group . compare)) + ((:doc-group . builtin)) div0 ((:doc-group . builtin)) compare ((:doc-group . builtin)) buffer ((:doc-group . io)) num? ((:doc-group . builtin)) builtin? ((:doc-group . builtin)) set-car! ((:doc-group . builtin)) cons? ((:doc-group . builtin)) aref ((:doc-group . builtin)) *properties* (:doc-group
props) vec ((:doc-group . builtin)) >= ((:doc-group . compare)) sym? ((:doc-group . builtin)) zero? ((:doc-group . compare)) length= ((:doc-group . list)) positive? ((:doc-group . compare)) doc-for ((:doc-group . docs)) aset! ((:doc-group . builtin)) car ((:doc-group . builtin)) *builtins* ((:doc-group . builtin)) str ((:doc-see . T)) cons ((:doc-group . builtin)) - ((:doc-group . builtin)) remprop ((:doc-group . props)) <= ((:doc-group . compare)) negative? ((:doc-group . compare)) Instructions ((:doc-group . builtin)) file ((:doc-group . io)) cdr ((:doc-group . builtin)) atom? ((:doc-group . builtin)) T ((:doc-see)) vec? ((:doc-group . builtin)) equal? ((:doc-group . builtin)) / ((:doc-group . builtin)) eqv? ((:doc-group . builtin)) io? ((:doc-group . io)) eof-object? ((:doc-group . io)) list ((:doc-group . builtin)) apply ((:doc-group . builtin)) help ((:doc-group . docs)) separate-doc-from-body ((:doc-group . docs)) = ((:doc-group . builtin)) not ((:doc-group . builtin)) set-cdr! ((:doc-group . builtin)) fn? ((:doc-group . builtin)) help-print-header ((:doc-group . docs)) arg-counts ((:doc-group . builtin)) eq? ((:doc-group . builtin)) getprop ((:doc-group . props)) putprop ((:doc-group . props)) * ((:doc-group . builtin)) io->str ((:doc-group . io))))
*syntax-environment* #table(bcode:nconst #fn("n1200r2e3:" #(aref)) doc-for #fn("z10B86;35040<;J404086;35040=70151<863I0212287e22289e22288e2e4:212287e22289e2e3:" #(separate-doc-from-body
@@ -226,10 +226,12 @@
J60q?4483R3<0700183D64:83H3\x97083EC:07102262:83KC:07102362:83DC:07102462:83J:07102562:7683513:07102762:7883513<0710298363:7102:8363:83<2;C<07<0183=63:83<RS;JD0483<Z;J;047=83<1523=07>01828364:83<892?CS07@83T513>07A018283T64:7102:83T63:892BC=07C01828364:892DC>07E018283=64:892FC;07G018363:892HCD07I2J183>22K01>262:892LC@07M018283=8465:892NC>07O018283=64:892PCE07Q0183T2D7R8351P64:892SCE07A01D83T5447102T62:892UC\x92083T7V7R8351518;<<8;=8:R360q@807W2X5148<3Z07Y8:8<8=<B;3G047Z8=<<51;3:047[8=<5153@30q47\\018:8=<64:892]Cp07A01q2Hq83Te35447^7_835151360q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym
emit load0 load1 loadt loadnil void? loadvoid fits-i8 loadi8 loadv aset! compile-aset! in-env?
compile-app quote self-evaluating? compile-in if compile-if begin compile-begin prog1
-2:892LC@07M018283=8465:892NC>07O018283=64:892PCE07Q0183T2D7R8351P64:892SCE07A01D83T5447102T62:892UC\x92083T7V7R8351518;<<8;=8:R360q@807W2X5148<3Z07Y8:8<8=<B;3G047Z8=<<51;3:047[8=<5153@30q47\\018:8=<64:892]Cp07A01q2Hq83Te35447^7_835151360q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym
+2:892LC@07M018283=8465:892NC>07O018283=64:892PCE07Q0183T2D7R8351P64:892SCE07A01D83T5447102T62:892UC\x92083T7V7R8351518;<<8;=8:R360q@807W2X5148<3Z07Y8:8<8=<B;3G047Z8=<<51;3:047[8=<5153@30q47\\018:8=<64:892]Cp07A01q2Hq83Te35447^7_835151360q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym
q47\\018:8=<64:892]Cp07A01q2Hq83Te35447^7_835151360q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym
-ompile-sym
- emit load0 load1 loadt loadnil void? loadvoid fits-i8 loadi8 loadv aset! compile-aset! in-env?
+q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym
+ emit load0 load1 loadt loadnil void? loadvoid fits-i8 loadi8 loadv aset! compile-aset! in-env?
+ compile-app quote self-evaluating? compile-in if compile-if begin compile-begin prog1
+ compile-prog1 λ call-with-values #fn("n070AF62:" #(compile-f-))
? compile-in if compile-if begin compile-begin prog1
compile-prog1 λ call-with-values #fn("n070AF62:" #(compile-f-))
#fn("n270A21053413K02223AF>2152470A242515163:q:" #(emit loadv #fn(for-each)
@@ -459,7 +461,7 @@
#fn(for-each)
#fn("n1200A62:" #(#fn(write)))
#fn(io->str)) print-to-str)
-table?)
+table?)
et)
*properties* #fn(table)
#fn(put!)) putprop)
--- a/src/plan9/lsd.sl
+++ b/src/plan9/lsd.sl
@@ -86,7 +86,10 @@
((:fpreg) fpregsf))]}
(io-pread f (reg-addr reg) (list (reg-size reg)))))
-(def (readsym symbol . rest)
+(def (symbol-read symbol . rest)
+ "Reads the value from the core file at the symbol's address"
+ :doc-group lsd
+ :doc-see sym-local
(unless coref (error "not attached to proc"))
(apply readcore (cons (symbol-addr symbol) rest)))
@@ -341,12 +344,29 @@
Examples:
- #;> (sym-find 'strecpy)
+ #;> (sym-global 'strecpy)
#(symbol \"strecpy\" #\\T 2276784)"
:doc-group lsd
(def (find tbl k) (and (has? tbl k) (get tbl k)))
(or (find (global-text globals) s)
(find (global-data globals) s)))
+
+(def (sym-local s)
+ "Return a local symbol from the attached proc's current stack
+ frame or NIL.
+ Input is a sym.
+
+ Examples:
+
+ #;> (sym-local 'i)
+ #(symbol \"i\" #\\a 140737488350940)
+ #;> (symbol-read (sym-local 'argc) 's32)
+ #s32(2)"
+ :doc-group lsd
+ (let {[ss (str s)]}
+ (find ss
+ (frame-locals (car (_stk)))
+ :key symbol-name)))
(def (sym-addr s)
"Return the address of a symbol from the attached proc's
--- a/src/system.sl
+++ b/src/system.sl
@@ -549,19 +549,30 @@
(cons elt
(delete-duplicates tail)))))))
+(def (find-if p lst (:key identity)
+ (:start 0)
+ (:end NIL)
+ (:from-end NIL))
+ (def (find-if- lst)
+ (if (or (not lst) (p (key (car lst))))
+ (car lst)
+ (find-if- (cdr lst))))
+ (set! lst (list-tail lst start))
+ (when end (set! lst (list-head lst (- end start))))
+ (when from-end (set! lst (reverse! lst)))
+ (find-if- lst))
+
(def (find e lst (:key identity)
(:test equal?)
(:start 0)
(:end NIL)
(:from-end NIL))
- (def (find- lst)
- (if (or (not lst) (test (key e) (key (car lst))))
- (car lst)
- (find- (cdr lst))))
- (set! lst (list-tail lst start))
- (when end (set! lst (list-head lst (- end start))))
- (when from-end (set! lst (reverse! lst)))
- (find- lst))
+ (find-if (λ (x) (test e x))
+ lst
+ :key key
+ :start start
+ :end end
+ :from-end from-end))
; you are not expected to understand this -- spew