|
Post Scarcity
A prototype for a post scarcity programming environment
|
#include <getopt.h>#include <locale.h>#include <stdbool.h>#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <wchar.h>#include <curl/curl.h>#include "arith/ratio.h"#include "version.h"#include "memory/conspage.h"#include "memory/consspaceobject.h"#include "memory/stack.h"#include "debug.h"#include "memory/hashmap.h"#include "ops/intern.h"#include "io/io.h"#include "io/fopen.h"#include "ops/lispops.h"#include "ops/meta.h"#include "arith/peano.h"#include "io/print.h"#include "repl.h"#include "time/psse_time.h"Go to the source code of this file.
Functions | |
| struct cons_pointer | bind_function (wchar_t *name, struct cons_pointer(*executable)(struct stack_frame *, struct cons_pointer, struct cons_pointer)) |
Bind this compiled executable function, as a Lisp function, to this name in the oblist. | |
| struct cons_pointer | bind_special (wchar_t *name, struct cons_pointer(*executable)(struct stack_frame *, struct cons_pointer, struct cons_pointer)) |
Bind this compiled executable function, as a Lisp special form, to this name in the oblist. | |
| struct cons_pointer | bind_symbol_value (struct cons_pointer symbol, struct cons_pointer value, bool lock) |
Bind this value to this symbol in the oblist. | |
| struct cons_pointer | bind_value (wchar_t *name, struct cons_pointer value, bool lock) |
Bind this value to this name in the oblist. | |
| struct cons_pointer | check_exception (struct cons_pointer pointer, char *location_descriptor) |
If pointer is an exception, display that exception to stderr, decrement that exception, and return NIL; else return the pointer. | |
| void | free_init_symbols () |
| int | main (int argc, char *argv[]) |
| main entry point; parse command line arguments, initialise the environment, and enter the read-eval-print loop. | |
| void | maybe_bind_init_symbols () |
| void | print_banner () |
| void | print_options (FILE *stream) |
Print command line options to this stream. | |
Variables | |
| struct cons_pointer | init_name_symbol = NIL |
| struct cons_pointer | init_primitive_symbol = NIL |
| struct cons_pointer bind_function | ( | wchar_t * | name, |
| struct cons_pointer(*)(struct stack_frame *, struct cons_pointer, struct cons_pointer) | executable | ||
| ) |
Bind this compiled executable function, as a Lisp function, to this name in the oblist.
Definition at line 97 of file init.c.
References c_string_to_lisp_symbol(), check_exception(), dec_ref(), deep_bind(), init_name_symbol, init_primitive_symbol, make_cons(), make_function(), NIL, and TRUE.
Referenced by main().
| struct cons_pointer bind_special | ( | wchar_t * | name, |
| struct cons_pointer(*)(struct stack_frame *, struct cons_pointer, struct cons_pointer) | executable | ||
| ) |
Bind this compiled executable function, as a Lisp special form, to this name in the oblist.
Definition at line 121 of file init.c.
References c_string_to_lisp_symbol(), check_exception(), dec_ref(), deep_bind(), init_name_symbol, init_primitive_symbol, make_cons(), make_special(), NIL, and TRUE.
Referenced by main().
| struct cons_pointer bind_symbol_value | ( | struct cons_pointer | symbol, |
| struct cons_pointer | value, | ||
| bool | lock | ||
| ) |
Bind this value to this symbol in the oblist.
Definition at line 144 of file init.c.
References check_exception(), cons_space_object::count, deep_bind(), exceptionp, and pointer2cell.
Referenced by bind_value(), and main().
| struct cons_pointer bind_value | ( | wchar_t * | name, |
| struct cons_pointer | value, | ||
| bool | lock | ||
| ) |
Bind this value to this name in the oblist.
Definition at line 161 of file init.c.
References bind_symbol_value(), c_string_to_lisp_symbol(), and dec_ref().
Referenced by main().
| struct cons_pointer check_exception | ( | struct cons_pointer | pointer, |
| char * | location_descriptor | ||
| ) |
If pointer is an exception, display that exception to stderr, decrement that exception, and return NIL; else return the pointer.
| pointer | a cons pointer. |
| location_descriptor | a description of where the pointer was caught. |
Definition at line 49 of file init.c.
References dec_ref(), exceptionp, file_to_url_file(), NIL, cons_space_object::payload, pointer2cell, and print().
Referenced by bind_function(), bind_special(), and bind_symbol_value().
| void free_init_symbols | ( | ) |
Definition at line 85 of file init.c.
References dec_ref(), init_name_symbol, and init_primitive_symbol.
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
main entry point; parse command line arguments, initialise the environment, and enter the read-eval-print loop.
Definition at line 206 of file init.c.
References bind_function(), bind_special(), bind_symbol_value(), bind_value(), C_IO_IN, C_IO_OUT, c_string_to_lisp_keyword(), c_string_to_lisp_string(), c_string_to_lisp_symbol(), DEBUG_BOOTSTRAP, debug_dump_object(), debug_print(), dec_ref(), dump_pages(), file_to_url_file(), free_init_symbols(), fcurl_data::handle, initialise_cons_pages(), io_init(), lisp_absolute(), lisp_add(), lisp_append(), lisp_apply(), lisp_assoc(), lisp_car(), lisp_cdr(), lisp_close(), lisp_cond(), lisp_cons(), lisp_divide(), lisp_eq(), lisp_equal(), lisp_eval(), lisp_exception(), lisp_get_hash(), lisp_hashmap_put(), lisp_hashmap_put_all(), lisp_inspect(), lisp_io_in, lisp_io_out, lisp_is_negative(), lisp_keys(), lisp_lambda(), lisp_let(), lisp_list(), lisp_make_hashmap(), lisp_mapcar(), lisp_metadata(), lisp_multiply(), lisp_nlambda(), lisp_oblist(), lisp_open(), lisp_print(), lisp_progn(), lisp_quote(), lisp_ratio_to_real(), lisp_read(), lisp_read_char(), lisp_repl(), lisp_reverse(), lisp_set(), lisp_set_shriek(), lisp_slurp(), lisp_source(), lisp_subtract(), lisp_time(), lisp_try(), lisp_type(), make_cons(), make_hashmap(), make_read_stream(), make_write_stream(), maybe_bind_init_symbols(), NIL, oblist, print_banner(), print_options(), privileged_symbol_nil, prompt_name, repl(), summarise_allocation(), TRUE, url_fopen(), and verbosity.
| void maybe_bind_init_symbols | ( | ) |
Definition at line 73 of file init.c.
References c_string_to_lisp_keyword(), c_string_to_lisp_symbol(), init_name_symbol, init_primitive_symbol, nilp, and privileged_symbol_nil.
Referenced by main().
| void print_banner | ( | ) |
| void print_options | ( | FILE * | stream | ) |
| struct cons_pointer init_name_symbol = NIL |
Definition at line 70 of file init.c.
Referenced by bind_function(), bind_special(), free_init_symbols(), and maybe_bind_init_symbols().
| struct cons_pointer init_primitive_symbol = NIL |
Definition at line 71 of file init.c.
Referenced by bind_function(), bind_special(), free_init_symbols(), and maybe_bind_init_symbols().