Now happy with what's appearing in the oblist. Reader is very broken.
This commit is contained in:
parent
5ec1c926b0
commit
d2efc8ba78
6 changed files with 44 additions and 8 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include "debug.h"
|
||||
|
||||
#include "environment/function_bindings.h"
|
||||
#include "environment/privileged_keywords.h"
|
||||
#include "memory/memory.h"
|
||||
#include "memory/node.h"
|
||||
#include "memory/pointer.h"
|
||||
|
|
@ -102,6 +103,8 @@ struct pso_pointer initialise_environment( uint32_t node ) {
|
|||
DEBUG_BOOTSTRAP, 0 );
|
||||
}
|
||||
|
||||
initialise_privileged_keywords(frame_pointer);
|
||||
|
||||
result = initialise_function_bindings(push_local(
|
||||
frame_pointer, make_frame_with_env(0, frame_pointer, result)));
|
||||
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ struct function_data function_initialisers[] = {
|
|||
U"`nil`.",
|
||||
¬},
|
||||
{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`.",
|
||||
&or},
|
||||
{U"true?",
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ struct pso_pointer privileged_keyword_location;
|
|||
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_documentation, PK_DOCUMENTATION);
|
||||
load_and_lock(privileged_keyword_location, PK_LOCATION);
|
||||
|
|
|
|||
19
src/c/io/alphabets.h
Normal file
19
src/c/io/alphabets.h
Normal 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
|
||||
|
|
@ -189,8 +189,14 @@ struct pso_pointer in_write( struct pso_pointer p, URL_FILE *output,
|
|||
} else {
|
||||
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:
|
||||
url_fwprintf( output, L"%d",
|
||||
( int64_t ) ( object->payload.integer.value ) );
|
||||
|
|
@ -211,6 +217,13 @@ struct pso_pointer in_write( struct pso_pointer p, URL_FILE *output,
|
|||
indent );
|
||||
write_char( L'>', output, escape );
|
||||
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:
|
||||
write_char( L't', output, escape );
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "memory/pso2.h"
|
||||
#include "memory/tags.h"
|
||||
|
||||
#include "ops/string_ops.h"
|
||||
#include "ops/truth.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
|
||||
* 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,
|
||||
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-- ) {
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue