shithub: femtolisp

Download patch

ref: edfdcd7d4818b632b0ca6ff0e3327d8e8279000c
parent: db907308eafb578adb3d8aebec76eb9293599d48
author: mag <mag-one@autistici.org>
date: Tue May 16 09:50:34 EDT 2023

equal.h

--- /dev/null
+++ b/equal.h
@@ -1,0 +1,11 @@
+#ifndef EQUAL_H
+#define EQUAL_H
+
+value_t fl_compare(value_t a, value_t b);
+value_t fl_equal(value_t a, value_t b);
+int equal_lispvalue(value_t a, value_t b);
+uintptr_t hash_lispvalue(value_t a);
+value_t compare_(value_t a, value_t b, int eq);
+
+#endif
+
--- a/equalhash.c
+++ b/equalhash.c
@@ -1,6 +1,7 @@
 #include "llt.h"
 #include "flisp.h"
 #include "equalhash.h"
+#include "equal.h"
 #include "htable.inc"
 
 #define _equal_lispvalue_(x, y) equal_lispvalue((value_t)(x), (value_t)(y))
--- a/flisp.c
+++ b/flisp.c
@@ -13,6 +13,7 @@
 #include "types.h"
 #include "print.h"
 #include "read.h"
+#include "equal.h"
 
 int
 isbuiltin(value_t x)
--- a/flisp.h
+++ b/flisp.h
@@ -314,30 +314,17 @@
         builtin_t fptr;
 }builtinspec_t;
 
-//--------------------------------------------------
-// Nothing changed here...just grouping by file.
-//--------------------------------------------------
-
 //--------------------------------------------------builtins.c
 size_t llength(value_t v);
 //--------------------------------------------------builtins.c
 
-//--------------------------------------------------equal.c
-value_t fl_compare(value_t a, value_t b);  // -1, 0, or 1
-value_t fl_equal(value_t a, value_t b); // T or nil
-int equal_lispvalue(value_t a, value_t b);
-uintptr_t hash_lispvalue(value_t a);
-//--------------------------------------------------equal.c
-
 //--------------------------------------------------iostream.c
 int fl_isiostream(value_t v);
 ios_t *fl_toiostream(value_t v);
 //--------------------------------------------------iostream.c
 
-
 //--------------------------------------------------------------------------------
 // New declarations here.. needed to permit files splitting
-// (and grouped by files).
 //--------------------------------------------------------------------------------
 extern value_t *Stack;
 extern uint32_t SP;
@@ -403,10 +390,6 @@
 #define BUILTIN_FN(l, c) extern BUILTIN(l, c);
 #include "builtin_fns.h"
 #undef BUILTIN_FN
-
-//--------------------------------------------------equal.c
-value_t compare_(value_t a, value_t b, int eq);
-//--------------------------------------------------equal.c
 
 #endif
 
--- a/string.c
+++ b/string.c
@@ -7,6 +7,7 @@
 #include "cvalues.h"
 #include "print.h"
 #include "read.h"
+#include "equal.h"
 
 BUILTIN("string?", stringp)
 {