Moved everything from ops/stack_ops (which were not ops) to payloads/stack.

Added io functions to function_bindings.
This commit is contained in:
Simon Brooke 2026-05-05 19:16:44 +01:00
parent 4d480798e8
commit 818293d4f1
34 changed files with 217 additions and 94 deletions

View file

@ -18,6 +18,12 @@
#include "debug.h"
#include "environment/privileged_keywords.h"
#include "io/io.h"
#include "io/peek.h"
#include "io/print.h"
#include "io/read.h"
#include "memory/node.h"
#include "memory/pointer.h"
#include "memory/tags.h"
@ -35,7 +41,7 @@
#include "ops/quote.h"
#include "ops/repl.h"
#include "ops/reverse.h"
#include "ops/stack_ops.h"
#include "payloads/stack.h"
#include "ops/string_ops.h"
#include "ops/truth.h"
@ -133,6 +139,54 @@ struct function_data {
/** initialisers for functions */
struct function_data function_initialisers[] = {
#ifdef _psse_io_io_h
{U"close", U"(close stream): close `stream`.", &lisp_close},
{U"open",
U"(open stream), (open stream write?): open `stream`; if `write?` is "
U"present and is non-nil, open for writing, else for reading.",
&lisp_open},
{U"slurp",
U"(slurp stream): read the whole contents of this `stream`, "
U"which may "
U"be an open stream open for reading or a URL, into a string, and return "
U"the "
U"string.",
&lisp_slurp},
#endif
#ifdef __psse_io_peek_h
{U"peek",
U"(peek stream): return the next character which may be read from "
U"`stream`, without removing it.",
&peek},
#endif
#ifdef __psse_io_print_h
{U"print",
U"(print object), (print object stream) print this `object` in a format "
U"suitable to be read by `read`, q.v.; if `stream` is specified and is a "
U"stream open for writing, to that stream.",
&print},
{U"princ",
U"(princ object), (princ object stream) print this `object` in a format "
U"more suited to human readers; if `stream` is specified and is a stream "
U"open for writing, to that stream.",
&print},
#endif
#ifdef __psse_io_read_h
{U"read",
U"(read stream) read one complete Lisp expression from `stream`, and "
U"return that expression unevaluated.",
&read},
{U"read-character",
U"(read_character stream): read a single character from `stream` and "
U"return it.",
&read_character},
{U"read_number",
U"(read-number stream): read a number from `stream` and return it.",
&read_number},
{U"read_symbol",
U"(read-symbol stream): read a symbol from `stream` and return it.",
&read_symbol},
#endif
#ifdef __psse_ops_assoc_h
{U"assoc",
U"(assoc key store): search `store` for the value associated with "