Now happy with what's appearing in the oblist. Reader is very broken.

This commit is contained in:
Simon Brooke 2026-05-04 19:26:09 +01:00
parent 5ec1c926b0
commit d2efc8ba78
6 changed files with 44 additions and 8 deletions

View file

@ -12,6 +12,7 @@
#include "debug.h" #include "debug.h"
#include "environment/function_bindings.h" #include "environment/function_bindings.h"
#include "environment/privileged_keywords.h"
#include "memory/memory.h" #include "memory/memory.h"
#include "memory/node.h" #include "memory/node.h"
#include "memory/pointer.h" #include "memory/pointer.h"
@ -100,7 +101,9 @@ struct pso_pointer initialise_environment( uint32_t node ) {
debug_print( U"\nEnvironment initialised successfully.\n", debug_print( U"\nEnvironment initialised successfully.\n",
DEBUG_BOOTSTRAP, 0 ); DEBUG_BOOTSTRAP, 0 );
} }
initialise_privileged_keywords(frame_pointer);
result = initialise_function_bindings(push_local( result = initialise_function_bindings(push_local(
frame_pointer, make_frame_with_env(0, frame_pointer, result))); frame_pointer, make_frame_with_env(0, frame_pointer, result)));

View file

@ -222,7 +222,7 @@ struct function_data function_initialisers[] = {
U"`nil`.", U"`nil`.",
&not}, &not},
{U"or", {U"or",
U"(or expressions...): returns `nil` if all of these `expressions...` " U"(or expressions...): returns `nil` if every one of these `expressions...` "
U"evaluates to `nil`, else `t`.", U"evaluates to `nil`, else `t`.",
&or}, &or},
{U"true?", {U"true?",

View file

@ -41,10 +41,10 @@ struct pso_pointer privileged_keyword_location;
struct pso_pointer privileged_keyword_name; struct pso_pointer privileged_keyword_name;
#define load_and_lock(var,val)var = lock_object(c_string_to_lisp_keyword(nil, val)) #define load_and_lock(var,val)(var = lock_object(c_string_to_lisp_keyword(frame_pointer, val)))
struct pso_pointer initialise_privileged_keywords(struct pso_pointer env) { struct pso_pointer initialise_privileged_keywords(struct pso_pointer frame_pointer) {
load_and_lock(privileged_keyword_bootstrap, PK_BOOTSTRAP); load_and_lock(privileged_keyword_bootstrap, PK_BOOTSTRAP);
load_and_lock(privileged_keyword_documentation, PK_DOCUMENTATION); load_and_lock(privileged_keyword_documentation, PK_DOCUMENTATION);
load_and_lock(privileged_keyword_location, PK_LOCATION); load_and_lock(privileged_keyword_location, PK_LOCATION);

19
src/c/io/alphabets.h Normal file
View file

@ -0,0 +1,19 @@
/*
* io/alphabets.h
*
* Post Scarcity Software Environment: alphabets
*
* I probably don't need these at this stage and may never in fact need them,
* but...
*
* (c) 2026 Simon Brooke <simon@journeyman.cc>
* Licensed under GPL version 2.0, or, at your option, any later version.
*/
#ifndef __psse_io_io_h
#define __psse_io_io_h
#define GREEK L"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"
#define ELDERFUTHARK L"ᚠᚢᚦᚨᚱᚲᚷᚹᚺᚾᛁᛃᛈᛇᛉᛊᛏᛒᛖᛗᛚᛜᛞᛟ"
#endif

View file

@ -189,8 +189,14 @@ struct pso_pointer in_write( struct pso_pointer p, URL_FILE *output,
} else { } else {
url_fputws( L"<broken exception :-( >", output ); url_fputws( L"<broken exception :-( >", output );
} }
} } break;
break; case FUNCTIONTV: {
struct pso2 *function = pointer_to_object(p);
url_fputws(L"<function: ", output);
in_write(function->payload.function.meta, output, escape,
indent);
write_char( L'>', output, escape );
} break;
case INTEGERTV: case INTEGERTV:
url_fwprintf( output, L"%d", url_fwprintf( output, L"%d",
( int64_t ) ( object->payload.integer.value ) ); ( int64_t ) ( object->payload.integer.value ) );
@ -211,6 +217,13 @@ struct pso_pointer in_write( struct pso_pointer p, URL_FILE *output,
indent ); indent );
write_char( L'>', output, escape ); write_char( L'>', output, escape );
break; break;
case SPECIALTV: {
struct pso2 *function = pointer_to_object(p);
url_fputws(L"<special form: ", output);
in_write(function->payload.function.meta, output, escape,
indent);
write_char( L'>', output, escape );
} break;
case TRUETV: case TRUETV:
write_char( L't', output, escape ); write_char( L't', output, escape );
break; break;

View file

@ -23,6 +23,7 @@
#include "memory/pso2.h" #include "memory/pso2.h"
#include "memory/tags.h" #include "memory/tags.h"
#include "ops/string_ops.h"
#include "ops/truth.h" #include "ops/truth.h"
#include "payloads/cons.h" #include "payloads/cons.h"
@ -174,7 +175,7 @@ char *lisp_string_to_c_string( struct pso_pointer s ) {
/** /**
* Return a lisp symbol representation of this wide character string. In * Return a lisp symbol representation of this wide character string. In
* symbols, I am accepting only lower case characters. * symbols, I am accepting only lower case characters and certain punctuation.
*/ */
struct pso_pointer c_string_to_lisp_symbol( struct pso_pointer frame_pointer, struct pso_pointer c_string_to_lisp_symbol( struct pso_pointer frame_pointer,
char32_t *symbol ) { char32_t *symbol ) {
@ -183,7 +184,7 @@ struct pso_pointer c_string_to_lisp_symbol( struct pso_pointer frame_pointer,
for ( int i = wcslen( symbol ) - 1; i >= 0; i-- ) { for ( int i = wcslen( symbol ) - 1; i >= 0; i-- ) {
char32_t c = towlower( symbol[i] ); char32_t c = towlower( symbol[i] );
if ( iswalpha( c ) || c == L'-' || c == L'*' ) { if ( iswalpha( c ) || wcschr(L"-*|!?", c)) {
result = make_symbol( frame_pointer, c, result ); result = make_symbol( frame_pointer, c, result );
} }
} }