|
Post Scarcity
A prototype for a post scarcity programming environment
|
#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <wchar.h>#include <wctype.h>#include "arith/integer.h"#include "debug.h"#include "io/io.h"#include "io/print.h"#include "memory/conspage.h"#include "memory/consspaceobject.h"#include "memory/hashmap.h"#include "memory/stack.h"#include "memory/vectorspace.h"#include "ops/intern.h"#include "time/psse_time.h"Go to the source code of this file.
Functions | |
| struct cons_pointer | lisp_print (struct stack_frame *frame, struct cons_pointer frame_pointer, struct cons_pointer env) |
| Function; print one complete lisp expression and return NIL. | |
| struct cons_pointer | lisp_println (struct stack_frame *frame, struct cons_pointer frame_pointer, struct cons_pointer env) |
(prinln out-stream): Print a new line character to out-stream, if it is specified and is an output stream, else to *out*. | |
| struct cons_pointer | print (URL_FILE *output, struct cons_pointer pointer) |
Print the cons-space object indicated by pointer to the stream indicated by output. | |
| void | print_128bit (URL_FILE *output, __int128_t n) |
| stolen from https://stackoverflow.com/questions/11656241/how-to-print-uint128-t-number-using-gcc | |
| void | print_list (URL_FILE *output, struct cons_pointer pointer) |
| void | print_list_contents (URL_FILE *output, struct cons_pointer pointer, bool initial_space) |
Print a single list cell (cons cell) indicated by pointer to the stream indicated by output. | |
| void | print_map (URL_FILE *output, struct cons_pointer map) |
| void | print_string (URL_FILE *output, struct cons_pointer pointer) |
print all the characters in the string indicated by pointer onto the stream at this output, prepending and appending double quote characters. | |
| void | print_string_contents (URL_FILE *output, struct cons_pointer pointer) |
print all the characters in the symbol or string indicated by pointer onto this output; if pointer does not indicate a string or symbol, don't print anything but just return. | |
| void | print_vso (URL_FILE *output, struct cons_pointer pointer) |
| void | println (URL_FILE *output) |
| struct cons_pointer lisp_print | ( | struct stack_frame * | frame, |
| struct cons_pointer | frame_pointer, | ||
| struct cons_pointer | env | ||
| ) |
Function; print one complete lisp expression and return NIL.
If write-stream is specified and is a write stream, then print to that stream, else the stream which is the value of *out* in the environment.
| frame | my stack_frame. |
| frame_pointer | a pointer to my stack_frame. |
| env | my environment (from which the stream may be extracted). |
Definition at line 295 of file print.c.
References debug_dump_object(), DEBUG_IO, debug_print(), dec_ref(), file_to_url_file(), get_default_stream(), inc_ref(), NIL, pointer2cell, print(), and writep.
Referenced by main().
| struct cons_pointer lisp_println | ( | struct stack_frame * | frame, |
| struct cons_pointer | frame_pointer, | ||
| struct cons_pointer | env | ||
| ) |
(prinln out-stream): Print a new line character to out-stream, if it is specified and is an output stream, else to *out*.
| frame | |
| frame_pointer | |
| env |
nil Definition at line 343 of file print.c.
References dec_ref(), file_to_url_file(), get_default_stream(), inc_ref(), NIL, pointer2cell, println(), and writep.
| struct cons_pointer print | ( | URL_FILE * | output, |
| struct cons_pointer | pointer | ||
| ) |
Print the cons-space object indicated by pointer to the stream indicated by output.
Definition at line 156 of file print.c.
References c_string_to_lisp_symbol(), CONSTV, dec_ref(), dump_stack_trace(), EXCEPTIONTV, FUNCTIONTV, integer_to_string(), INTEGERTV, KEYTV, LAMBDATV, make_cons(), NILTV, NLAMBDATV, cons_space_object::payload, pointer2cell, print(), print_128bit(), print_list(), print_string(), print_string_contents(), print_vso(), RATIOTV, READTV, REALTV, SPECIALTV, STRINGTV, SYMBOLTV, cons_space_object::tag, time_to_string(), TIMETV, TRUETV, url_fputwc, url_fputws, url_fwprintf, VECTORPOINTTV, and WRITETV.
Referenced by check_exception(), debug_print_object(), dump_frame(), dump_frame_context_fragment(), dump_map(), dump_object(), dump_stack_trace(), dump_string_cell(), lisp_print(), lisp_repl(), print(), print_list_contents(), and print_map().
| void print_128bit | ( | URL_FILE * | output, |
| __int128_t | n | ||
| ) |
stolen from https://stackoverflow.com/questions/11656241/how-to-print-uint128-t-number-using-gcc
Definition at line 134 of file print.c.
References url_fwprintf.
Referenced by print().
| void print_list | ( | URL_FILE * | output, |
| struct cons_pointer | pointer | ||
| ) |
Definition at line 87 of file print.c.
References print_list_contents(), and url_fputws.
Referenced by print().
| void print_list_contents | ( | URL_FILE * | output, |
| struct cons_pointer | pointer, | ||
| bool | initial_space | ||
| ) |
Print a single list cell (cons cell) indicated by pointer to the stream indicated by output.
if initial_space is true, prepend a space character.
Definition at line 66 of file print.c.
References CONSTV, NILTV, cons_space_object::payload, pointer2cell, print(), print_list_contents(), cons_space_object::tag, url_fputwc, and url_fwprintf.
Referenced by print_list(), and print_list_contents().
| void print_map | ( | URL_FILE * | output, |
| struct cons_pointer | map | ||
| ) |
Definition at line 93 of file print.c.
References c_car(), c_cdr(), hashmap_get(), hashmap_keys(), hashmapp, nilp, pointer_to_vso, print(), url_fputwc, and url_fputws.
Referenced by print_vso().
| void print_string | ( | URL_FILE * | output, |
| struct cons_pointer | pointer | ||
| ) |
print all the characters in the string indicated by pointer onto the stream at this output, prepending and appending double quote characters.
Definition at line 54 of file print.c.
References print_string_contents(), and url_fputwc.
Referenced by print().
| void print_string_contents | ( | URL_FILE * | output, |
| struct cons_pointer | pointer | ||
| ) |
print all the characters in the symbol or string indicated by pointer onto this output; if pointer does not indicate a string or symbol, don't print anything but just return.
Definition at line 37 of file print.c.
References keywordp, cons_space_object::payload, pointer2cell, stringp, symbolp, and url_fputwc.
Referenced by print(), and print_string().
| void print_vso | ( | URL_FILE * | output, |
| struct cons_pointer | pointer | ||
| ) |
Definition at line 115 of file print.c.
References dump_stack_trace(), HASHTV, vector_space_object::header, pointer_to_vso, print_map(), STACKFRAMETV, and vector_space_header::tag.
Referenced by print().
| void println | ( | URL_FILE * | output | ) |
Definition at line 329 of file print.c.
References url_fputws.
Referenced by lisp_println(), and lisp_repl().