From b1eddfd6bd8bf6549a1d2e772caad3790a772d2e Mon Sep 17 00:00:00 2001 From: Wodan58 Date: Tue, 25 Jun 2024 08:35:07 +0200 Subject: [PATCH] Patch Tuesday - G --- CMakeLists.txt | 9 +++++---- globals.h | 12 ++++++----- lexr.l | 13 ++++++------ lib/CMakeLists.txt | 19 ++++++------------ module.c | 16 ++++++--------- scan.c | 48 +++++++++++++------------------------------- src/abort.c | 6 +++--- src/assign.c | 6 +++--- src/casting.c | 6 +++--- src/filetime.c | 6 +++--- src/finclude.c | 6 +++--- src/over.c | 6 +++--- src/pick.c | 6 +++--- src/quit.c | 6 +++--- src/small.c | 6 ++++-- src/typeof.c | 6 +++--- src/unassign.c | 6 +++--- tabl.c | 16 +++++++-------- test1/CMakeLists.txt | 8 ++++---- test1/tut.joy | 14 +++++-------- test2/CMakeLists.txt | 7 +++++-- test2/compare.joy | 19 ++++++++++++++++-- test2/gc2.joy | 8 ++++---- test2/small.joy | 10 +++++++-- test2/times.joy | 6 ++++-- writ.c | 6 +++--- xerr.c | 6 +++--- 27 files changed, 139 insertions(+), 144 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39e48f9..b2edb1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # # module : CMakeLists.txt -# version : 1.24 -# date : 05/28/24 +# version : 1.25 +# date : 06/22/24 # cmake_minimum_required(VERSION 3.5) project(Joy VERSION 1.0) @@ -72,8 +72,9 @@ else() set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CF}") add_definitions(-DCOMP="\\"${CMAKE_C_FLAGS_RELEASE}\\"") else() - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CF} -g -O0 --coverage -fprofile-arcs -ftest-coverage") # debug, no optimization - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") # enabling coverage + set(CMAKE_C_FLAGS_DEBUG # debug, enabling coverage + "${CMAKE_C_FLAGS_DEBUG} ${CF} -O3 --coverage -fprofile-arcs -ftest-coverage") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") add_definitions(-DCOMP="\\"${CMAKE_C_FLAGS_DEBUG}\\"") endif() target_link_libraries(joy m gc) diff --git a/globals.h b/globals.h index efffc29..dccae56 100644 --- a/globals.h +++ b/globals.h @@ -1,7 +1,7 @@ /* module : globals.h - version : 1.48 - date : 05/28/24 + version : 1.49 + date : 06/22/24 */ #ifndef GLOBALS_H #define GLOBALS_H @@ -47,7 +47,7 @@ #define INPLINEMAX 255 #define BUFFERMAX 80 /* smaller buffer */ #define HELPLINEMAX 72 -#define MAXNUM 32 /* even smaller buffer */ +#define MAXNUM 40 /* even smaller buffer */ #define FILENAMEMAX 14 #define DISPLAYMAX 10 /* nesting in HIDE & MODULE */ #define INIECHOFLAG 0 @@ -183,8 +183,10 @@ typedef struct Token { * The symbol table is accessed through two hash tables, one with name as * index; the other with function address as index, cast to uint64_t. */ -KHASHL_MAP_INIT(KH_LOCAL, symtab_t, symtab, kh_cstr_t, int, kh_hash_str, kh_eq_str) -KHASHL_MAP_INIT(KH_LOCAL, funtab_t, funtab, uint64_t, int, kh_hash_uint64, kh_eq_generic) +KHASHL_MAP_INIT(KH_LOCAL, symtab_t, symtab, kh_cstr_t, int, kh_hash_str, + kh_eq_str) +KHASHL_MAP_INIT(KH_LOCAL, funtab_t, funtab, uint64_t, int, kh_hash_uint64, + kh_eq_generic) /* * Global variables are stored locally in the main function. diff --git a/lexr.l b/lexr.l index 0242ca5..5b523e2 100644 --- a/lexr.l +++ b/lexr.l @@ -1,8 +1,8 @@ %{ /* module : lexr.l - version : 1.33 - date : 05/06/24 + version : 1.34 + date : 06/22/24 */ #include "globals.h" @@ -78,9 +78,7 @@ void new_buffer(void) void old_buffer(int num) { - if (--include_stack_ptr < 0) - include_stack_ptr = 0; - if (include_stack[include_stack_ptr]) + if (include_stack[--include_stack_ptr]) yy_switch_to_buffer(include_stack[include_stack_ptr]); yylineno = num; /* restart old file */ linenum = num + 1; @@ -153,9 +151,10 @@ INLINE[ \t]* return CONST_; {comment} { addline('('); addline('*'); BEGIN COMMENT; } {linecom} { /* default to ECHO */ } ^\$.* { int rv; if (!env->ignore) { rv = system(yytext + 1); if (rv) - { fflush(stdout); fprintf(stderr, "system: %d\n", rv); } } } + { fflush(stdout); fprintf(stderr, "system: %u\n", rv & 0xFF); + } } } [ \b\t\n\v\f\r] ; [;[\]{}] | . return yytext[0]; -%% +%% /* LCOV_EXCL_LINE */ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index c62c8d8..e399899 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -1,33 +1,26 @@ # # module : CMakeLists.txt -# version : 1.4 -# date : 03/23/24 +# version : 1.5 +# date : 06/21/24 # macro(exe9 src) add_custom_target(${src}.out ALL WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lib DEPENDS joy ${CMAKE_SOURCE_DIR}/lib/${src}.joy - COMMAND joy ${CMAKE_SOURCE_DIR}/lib/${src}.joy >${src}.oud) + COMMAND joy -x ${CMAKE_SOURCE_DIR}/lib/${src}.joy >${src}.oud) endmacro(exe9) macro(exe8 src) add_custom_target(${src}.out ALL WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lib DEPENDS joy ${CMAKE_SOURCE_DIR}/lib/${src}.joy - COMMAND joy ${CMAKE_SOURCE_DIR}/lib/${src}.joy 24 54 >${src}.oud) + COMMAND joy -x ${CMAKE_SOURCE_DIR}/lib/${src}.joy 24 54 >${src}.oud) endmacro(exe8) -macro(exe7 src) -add_custom_target(${src}.out ALL - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/lib - DEPENDS joy ${CMAKE_SOURCE_DIR}/lib/${src}.joy - COMMAND joy -x ${CMAKE_SOURCE_DIR}/lib/${src}.joy >${src}.oud) -endmacro(exe7) - +exe8(gcd) +exe9(grmtst) exe9(alljoy) exe9(flatjoy) -exe8(gcd) -exe7(grmtst) exe9(jp-church) exe9(jp-joytst) exe9(jp-nestrec) diff --git a/module.c b/module.c index 6367b9d..e9b7f13 100644 --- a/module.c +++ b/module.c @@ -1,7 +1,7 @@ /* module : module.c - version : 1.13 - date : 05/27/24 + version : 1.14 + date : 06/21/24 */ #include "globals.h" @@ -41,11 +41,9 @@ void undomod(int hide, int modl, int hcnt) */ void initmod(pEnv env, char *name) { - if (++module_index >= DISPLAYMAX) { - module_index = -1; + if (module_index + 1 == DISPLAYMAX) execerror("index", "display"); - } - env->module_stack[module_index].name = name; + env->module_stack[++module_index].name = name; env->module_stack[module_index].hide = hide_index; } @@ -60,11 +58,9 @@ void initmod(pEnv env, char *name) */ void initpriv(pEnv env) { - if (++hide_index >= DISPLAYMAX) { - hide_index = -1; + if (hide_index + 1 == DISPLAYMAX) execerror("index", "display"); - } - env->hide_stack[hide_index] = ++hide_count; + env->hide_stack[++hide_index] = ++hide_count; inside_hide = 1; } diff --git a/scan.c b/scan.c index 221a490..e0c1c1e 100644 --- a/scan.c +++ b/scan.c @@ -1,7 +1,7 @@ /* module : scan.c - version : 1.21 - date : 05/27/24 + version : 1.22 + date : 06/22/24 */ #include "globals.h" @@ -52,22 +52,19 @@ static void redirect(FILE *fp, char *str) */ int include(pEnv env, char *name) { - /* - * mustinclude - determine whether an attempt must be made to include - * usrlib.joy - */ FILE *fp; char *path = 0, *str = name; /* - * usrlib.joy is tried first in the current directory, then in the home - * directory and then in the directory where the joy binary is located. - * - * If all of that fails, no harm done. + * A file is first tried in the current directory. + */ + if ((fp = fopen(name, "r")) != 0) + goto normal; + /* + * usrlib.joy is tried in the home directory and then in the directory + * where the joy binary is located. */ if (!strcmp(name, "usrlib.joy")) { /* check usrlib.joy */ - if ((fp = fopen(name, "r")) != 0) /* current dir */ - goto normal; if ((path = getenv("HOME")) != 0) { /* unix/cygwin */ str = GC_malloc_atomic(strlen(path) + strlen(name) + 2); sprintf(str, "%s/%s", path, name); @@ -80,33 +77,16 @@ int include(pEnv env, char *name) if ((fp = fopen(str, "r")) != 0) goto normal; } - path = env->pathname; /* joy binary */ - if (strcmp(path, ".")) { - str = GC_malloc_atomic(strlen(path) + strlen(name) + 2); - sprintf(str, "%s/%s", path, name); - if ((fp = fopen(str, "r")) != 0) - goto normal; - } - /* - * Failure to open usrlib.joy need not be reported. - */ - return 1; } - /* - * A file other than usrlib.joy is tried first in the current directory. - */ - if ((fp = fopen(name, "r")) != 0) - goto normal; /* * If that fails, the pathname is prepended and the file is tried again. */ - path = env->pathname; + path = env->pathname; /* joy binary */ if (strcmp(path, ".")) { str = GC_malloc_atomic(strlen(path) + strlen(name) + 2); sprintf(str, "%s/%s", path, name); - if ((fp = fopen(str, "r")) != 0) - goto normal; - return 1; + if ((fp = fopen(str, "r")) == 0) + return 1; } normal: /* @@ -149,7 +129,7 @@ void my_error(char *str, YYLTYPE *bloc) fprintf(stderr, "%s\n%*s^\n%*s%s\n", line, leng, "", leng, "", str); line[0] = 0; /* invalidate line */ abortexecution_(ABORT_RETRY); -} +} /* LCOV_EXCL_LINE */ /* * yyerror - error processing during source file read; location info global. @@ -160,4 +140,4 @@ void yyerror(pEnv env, char *str) bloc.last_column = yylloc.last_column; my_error(str, &bloc); -} +} /* LCOV_EXCL_LINE */ diff --git a/src/abort.c b/src/abort.c index 1429349..b062083 100644 --- a/src/abort.c +++ b/src/abort.c @@ -1,7 +1,7 @@ /* module : abort.c - version : 1.10 - date : 03/21/24 + version : 1.11 + date : 06/22/24 */ #ifndef ABORT_C #define ABORT_C @@ -13,5 +13,5 @@ Aborts execution of current Joy program, returns to Joy main cycle. void abort_(pEnv env) { abortexecution_(ABORT_RETRY); -} +} /* LCOV_EXCL_LINE */ #endif diff --git a/src/assign.c b/src/assign.c index e79c89a..1177429 100644 --- a/src/assign.c +++ b/src/assign.c @@ -1,13 +1,13 @@ /* module : assign.c - version : 1.3 - date : 03/21/24 + version : 1.4 + date : 06/22/24 */ #ifndef ASSIGN_C #define ASSIGN_C /** -Q0 IGNORE_POP 3190 assign : DD V [N] -> +Q0 IGNORE_POP 3140 assign : DD V [N] -> [IMPURE] Assigns value V to the variable with name N. */ void assign_(pEnv env) diff --git a/src/casting.c b/src/casting.c index 4100b2c..88ff300 100644 --- a/src/casting.c +++ b/src/casting.c @@ -1,13 +1,13 @@ /* module : casting.c - version : 1.10 - date : 03/05/24 + version : 1.11 + date : 06/22/24 */ #ifndef CASTING_C #define CASTING_C /** -Q0 OK 3140 casting : DDA X Y -> Z +Q0 OK 3150 casting : DDA X Y -> Z [EXT] Z takes the value from X and uses the value from Y as its type. */ void casting_(pEnv env) diff --git a/src/filetime.c b/src/filetime.c index bfee33e..6680fa1 100644 --- a/src/filetime.c +++ b/src/filetime.c @@ -1,7 +1,7 @@ /* module : filetime.c - version : 1.12 - date : 03/05/24 + version : 1.13 + date : 06/22/24 */ #ifndef FILETIME_C #define FILETIME_C @@ -9,7 +9,7 @@ #include /** -Q0 OK 3150 filetime : DA F -> T +Q0 OK 3160 filetime : DA F -> T [FOREIGN] T is the modification time of file F. */ void filetime_(pEnv env) diff --git a/src/finclude.c b/src/finclude.c index 25fd132..898be06 100644 --- a/src/finclude.c +++ b/src/finclude.c @@ -1,13 +1,13 @@ /* module : finclude.c - version : 1.12 - date : 05/27/24 + version : 1.13 + date : 06/22/24 */ #ifndef FINCLUDE_C #define FINCLUDE_C /** -Q0 OK 3160 finclude : DU S -> F ... +Q0 OK 3170 finclude : DU S -> F ... [FOREIGN] Reads Joy source code from stream S and pushes it onto stack. */ void finclude_(pEnv env) diff --git a/src/over.c b/src/over.c index ae75df0..590d846 100644 --- a/src/over.c +++ b/src/over.c @@ -1,13 +1,13 @@ /* module : over.c - version : 1.11 - date : 03/05/24 + version : 1.12 + date : 06/22/24 */ #ifndef OVER_C #define OVER_C /** -Q0 OK 3170 over : A X Y -> X Y X +Q0 OK 3180 over : A X Y -> X Y X [EXT] Pushes an extra copy of the second item X on top of the stack. */ void over_(pEnv env) diff --git a/src/pick.c b/src/pick.c index 8d8d751..1f5d2a1 100644 --- a/src/pick.c +++ b/src/pick.c @@ -1,13 +1,13 @@ /* module : pick.c - version : 1.13 - date : 03/05/24 + version : 1.14 + date : 06/22/24 */ #ifndef PICK_C #define PICK_C /** -Q0 OK 3180 pick : DA X Y Z 2 -> X Y Z X +Q0 OK 3190 pick : DA X Y Z 2 -> X Y Z X [EXT] Pushes an extra copy of nth (e.g. 2) item X on top of the stack. */ void pick_(pEnv env) diff --git a/src/quit.c b/src/quit.c index c66f9d9..ff733b8 100644 --- a/src/quit.c +++ b/src/quit.c @@ -1,7 +1,7 @@ /* module : quit.c - version : 1.13 - date : 04/29/24 + version : 1.14 + date : 06/22/24 */ #ifndef QUIT_C #define QUIT_C @@ -13,5 +13,5 @@ Exit from Joy. void quit_(pEnv env) { abortexecution_(ABORT_QUIT); -} +} /* LCOV_EXCL_LINE */ #endif diff --git a/src/small.c b/src/small.c index 96fa802..a74553b 100644 --- a/src/small.c +++ b/src/small.c @@ -1,7 +1,7 @@ /* module : small.c - version : 1.12 - date : 04/11/24 + version : 1.13 + date : 06/22/24 */ #ifndef SMALL_C #define SMALL_C @@ -49,12 +49,14 @@ void small_(pEnv env) case USR_LIST_: node.u.num = pvec_cnt(node.u.lis) < 2; break; +#if 0 case FLOAT_: node.u.num = node.u.dbl >= 0 && node.u.dbl < 2; break; case FILE_: node.u.num = !node.u.fil || (node.u.fil - stdin) < 2; break; +#endif #ifdef USE_BIGNUM_ARITHMETIC case BIGNUM_: node.u.num = node.u.str[1] == '0' || !strcmp(node.u.str, " 1"); diff --git a/src/typeof.c b/src/typeof.c index 57c1d90..56e7a13 100644 --- a/src/typeof.c +++ b/src/typeof.c @@ -1,13 +1,13 @@ /* module : typeof.c - version : 1.14 - date : 03/05/24 + version : 1.15 + date : 06/22/24 */ #ifndef TYPEOF_C #define TYPEOF_C /** -Q0 OK 3230 typeof : DA X -> I +Q0 OK 3220 typeof : DA X -> I [EXT] Replace X by its type. */ void typeof_(pEnv env) diff --git a/src/unassign.c b/src/unassign.c index d0d6bb3..46048c8 100644 --- a/src/unassign.c +++ b/src/unassign.c @@ -1,13 +1,13 @@ /* module : unassign.c - version : 1.1 - date : 05/06/24 + version : 1.2 + date : 06/22/24 */ #ifndef UNASSIGN_C #define UNASSIGN_C /** -Q0 IGNORE_POP 3235 unassign : D [N] -> +Q0 IGNORE_POP 3230 unassign : D [N] -> [IMPURE] Sets the body of the name N to uninitialized. */ void unassign_(pEnv env) diff --git a/tabl.c b/tabl.c index 8710561..b3fb507 100644 --- a/tabl.c +++ b/tabl.c @@ -212,17 +212,17 @@ /* 3110 */ { Q0, OK, "include", include_, "D", "\"filnam.ext\" ->", "Transfers input to file whose name is \"filnam.ext\".\nOn end-of-file returns to previous input file.\n" }, /* 3120 */ { Q0, IGNORE_OK, "abort", abort_, "N", "->", "Aborts execution of current Joy program, returns to Joy main cycle.\n" }, /* 3130 */ { Q0, IGNORE_OK, "quit", quit_, "N", "->", "Exit from Joy.\n" }, -/* 3140 */ { Q0, OK, "casting", casting_, "DDA", "X Y -> Z", "[EXT] Z takes the value from X and uses the value from Y as its type.\n" }, -/* 3150 */ { Q0, OK, "filetime", filetime_, "DA", "F -> T", "[FOREIGN] T is the modification time of file F.\n" }, -/* 3160 */ { Q0, OK, "finclude", finclude_, "DU", "S -> F ...", "[FOREIGN] Reads Joy source code from stream S and pushes it onto stack.\n" }, -/* 3170 */ { Q0, OK, "over", over_, "A", "X Y -> X Y X", "[EXT] Pushes an extra copy of the second item X on top of the stack.\n" }, -/* 3180 */ { Q0, OK, "pick", pick_, "DA", "X Y Z 2 -> X Y Z X", "[EXT] Pushes an extra copy of nth (e.g. 2) item X on top of the stack.\n" }, -/* 3190 */ { Q0, IGNORE_POP, "assign", assign_, "DD", "V [N] ->", "[IMPURE] Assigns value V to the variable with name N.\n" }, +/* 3140 */ { Q0, IGNORE_POP, "assign", assign_, "DD", "V [N] ->", "[IMPURE] Assigns value V to the variable with name N.\n" }, +/* 3150 */ { Q0, OK, "casting", casting_, "DDA", "X Y -> Z", "[EXT] Z takes the value from X and uses the value from Y as its type.\n" }, +/* 3160 */ { Q0, OK, "filetime", filetime_, "DA", "F -> T", "[FOREIGN] T is the modification time of file F.\n" }, +/* 3170 */ { Q0, OK, "finclude", finclude_, "DU", "S -> F ...", "[FOREIGN] Reads Joy source code from stream S and pushes it onto stack.\n" }, +/* 3180 */ { Q0, OK, "over", over_, "A", "X Y -> X Y X", "[EXT] Pushes an extra copy of the second item X on top of the stack.\n" }, +/* 3190 */ { Q0, OK, "pick", pick_, "DA", "X Y Z 2 -> X Y Z X", "[EXT] Pushes an extra copy of nth (e.g. 2) item X on top of the stack.\n" }, /* 3200 */ { Q0, OK, "round", round_, "DA", "F -> G", "[EXT] G is F rounded to the nearest integer.\n" }, /* 3210 */ { Q0, OK, "sametype", sametype_, "DDA", "X Y -> B", "[EXT] Tests whether X and Y have the same type.\n" }, /* 3220 */ { Q0, OK, "scale", scale_, "D", "I ->", "[NUM] Sets the number of digits to be used after the decimal point.\n" }, -/* 3230 */ { Q0, OK, "typeof", typeof_, "DA", "X -> I", "[EXT] Replace X by its type.\n" }, -/* 3235 */ { Q0, IGNORE_POP, "unassign", unassign_, "D", "[N] ->", "[IMPURE] Sets the body of the name N to uninitialized.\n" }, +/* 3220 */ { Q0, OK, "typeof", typeof_, "DA", "X -> I", "[EXT] Replace X by its type.\n" }, +/* 3230 */ { Q0, IGNORE_POP, "unassign", unassign_, "D", "[N] ->", "[IMPURE] Sets the body of the name N to uninitialized.\n" }, /* 3240 */ { Q0, OK, "exit", exit_, "N", "->", "[MTH] Exit a thread.\n" }, /* 3250 */ { Q0, OK, "kill", kill_, "N", "->", "[MTH] Make all threads eligible for garbage collection.\n" }, /* 3260 */ { Q0, OK, "recv", recv_, "A", "P -> P N", "[MTH] Receive a node from a channel and push it on the stack.\n" }, diff --git a/test1/CMakeLists.txt b/test1/CMakeLists.txt index c1405f7..7a3a097 100644 --- a/test1/CMakeLists.txt +++ b/test1/CMakeLists.txt @@ -1,7 +1,7 @@ # # module : CMakeLists.txt -# version : 1.2 -# date : 04/12/24 +# version : 1.3 +# date : 06/21/24 # macro(exe9 src) add_custom_target(${src}.out ALL @@ -51,9 +51,9 @@ add_custom_target(${src}.out ALL endmacro(exe4) exe4(exist) -exe7(empty) -exe6(minim) exe5(tut) +exe6(minim) +exe7(empty) exe8(scan) exe9(parm) exe9(const) diff --git a/test1/tut.joy b/test1/tut.joy index d745194..1d7d359 100644 --- a/test1/tut.joy +++ b/test1/tut.joy @@ -1,7 +1,7 @@ (* module : tut.joy version : 1.2 - date : 03/11/24 + date : 06/11/24 *) 111 222 +. 1 2 + 3 4 + *. @@ -40,15 +40,13 @@ DEFINE sum == 0 [+] fold; DEFINE putsp == put space putch; newline == '\n putch; - putln == put newline. + putln == put newline; + length == 0 [pop 1 +] fold. [11 22 33 44 55] uncons uncons putsp putsp putsp newline. ['a 'b] ['d 'e 'f] concat dup. uncons uncons 'c swap cons cons cons dup. - -DEFINE length == 0 [pop 1 +] fold. - dup length. reverse length. @@ -85,12 +83,10 @@ DEFINE square == dup *. [1 2 3] 0 [dup * +] fold. DEFINE unit == [] cons; - construct2 == [[nullary] cons i] map. + construct2 == [[nullary] cons i] map; + unpair == uncons uncons pop. 11 12 [[+] [*] [pop unit] [dup pair]] construct2. - -DEFINE unpair == uncons uncons pop. - [[pair [square] map unpair +] [pop] []] construct2. [] unstack. 11111. diff --git a/test2/CMakeLists.txt b/test2/CMakeLists.txt index 8213703..38bb38e 100644 --- a/test2/CMakeLists.txt +++ b/test2/CMakeLists.txt @@ -1,7 +1,7 @@ # # module : CMakeLists.txt -# version : 1.13 -# date : 05/02/24 +# version : 1.14 +# date : 06/21/24 # macro(exe9 src) add_custom_target(${src}.out ALL @@ -34,6 +34,7 @@ exe9(app4) exe9(argc) exe9(argv) exe9(asin) +exe9(assign) exe9(at) exe9(atan) exe9(atan2) @@ -82,6 +83,7 @@ exe9(fgets) exe9(file) exe9(filetime) exe9(filter) +exe9(finclude) exe9(first) exe9(float) exe9(floor) @@ -223,6 +225,7 @@ exe9(unary) exe9(unary2) exe9(unary3) exe9(unary4) +exe9(unassign) exe9(uncons) exe9(undeferror) exe9(undefs) diff --git a/test2/compare.joy b/test2/compare.joy index b02ae3c..26b351c 100644 --- a/test2/compare.joy +++ b/test2/compare.joy @@ -1,7 +1,7 @@ (* module : compare.joy - version : 1.8 - date : 04/15/24 + version : 1.9 + date : 06/21/24 *) [1 2 3] [1 2 3] compare 1 =. (* 1 means unequal in case of lists *) [1 2 3] [1 2 3 4] compare 1 =. @@ -31,3 +31,18 @@ false true compare -1 =. 1.1 1.0 compare 1 =. stdin stdin compare 0 =. stdin stdout compare -1 =. + +true 1.0 compare 0 =. +false 0.0 compare 0 =. +1.0 true compare 0 =. +0.0 false compare 0 =. + +{} "empty" compare -1 =. +{0} "empty" compare -1 =. +false "false" compare 1 =. + +"empty" {} compare 1 =. +"empty" {0} compare 1 =. +"false" false compare 1 =. + +{-1}. diff --git a/test2/gc2.joy b/test2/gc2.joy index 55a1565..9547f99 100644 --- a/test2/gc2.joy +++ b/test2/gc2.joy @@ -1,8 +1,8 @@ (* module : gc2.joy - version : 1.9 - date : 04/15/24 + version : 1.11 + date : 06/13/24 *) -__memorymax -1 300 from-to-list pop gc +__memoryindex +1 14000 from-to-list pop gc __memorymax <. diff --git a/test2/small.joy b/test2/small.joy index ee2d00a..d7df6ab 100644 --- a/test2/small.joy +++ b/test2/small.joy @@ -1,7 +1,7 @@ (* module : small.joy - version : 1.4 - date : 03/21/24 + version : 1.5 + date : 06/21/24 *) [] small. [1] small. @@ -17,3 +17,9 @@ 2 small false =. [pop] first small =. + +# 0.0 small =. +# 1.0 small =. + +# stdin small =. +# stdout small =. diff --git a/test2/times.joy b/test2/times.joy index f9414cf..409f56c 100644 --- a/test2/times.joy +++ b/test2/times.joy @@ -1,7 +1,7 @@ (* module : times.joy - version : 1.6 - date : 04/15/24 + version : 1.7 + date : 06/21/24 *) "numlib" libload. @@ -10,3 +10,5 @@ 1 10 [] times 1 =. 1 0 [succ] times 1 =. + +1 -1 [succ] times. diff --git a/writ.c b/writ.c index e2a95a9..60d8bb7 100644 --- a/writ.c +++ b/writ.c @@ -1,7 +1,7 @@ /* * module : writ.c - * version : 1.24 - * date : 04/23/24 + * version : 1.25 + * date : 06/22/24 */ #include "globals.h" @@ -14,7 +14,7 @@ void writefactor(pEnv env, Node node, FILE *fp) { int i; uint64_t set, j; - char *ptr, buf[MAXNUM], tmp[MAXNUM]; + char *ptr, buf[BUFFERMAX], tmp[MAXNUM]; #if 0 /* diff --git a/xerr.c b/xerr.c index 6857762..92c26c0 100644 --- a/xerr.c +++ b/xerr.c @@ -1,7 +1,7 @@ /* * module : xerr.c - * version : 1.3 - * date : 04/23/24 + * version : 1.4 + * date : 06/22/24 */ #include "globals.h" @@ -24,4 +24,4 @@ void execerror(char *message, char *op) fflush(stdout); fprintf(stderr, "run time error: %s needed for %.*s\n", message, leng, ptr); abortexecution_(ABORT_ERROR); -} +} /* LCOV_EXCL_LINE */