ref: 45de5e57e4f8eea540a5b4c39b5512c8513e6032
parent: c9b8a86744a09675fa6c3582d2904fac287c1611
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Mar 18 14:17:16 EDT 2025
constant? → const?
--- a/boot/sl.boot
+++ b/boot/sl.boot
@@ -178,8 +178,8 @@
3T64:7102:83T63:892BC=07C01828364:892DC>07E018283=64:892FC;07G018363:892HCD07I2J183>22K01>262:892LC@07M018283=8465:892NC>07O018283=64:892PCE07Q0183T2D7R8351P64:892SCE07A01D83T5447102T62:892UC\x93083T7R83517V8;518:R360q@807W2X5148<3`08;=?;47Y8:8<8;<B;3G047Z8;<<51;3:047[8;<5153@30q47\\018:8;<64:892]Cp07A01q2Hq83Te35447^7_835151360q@807W2`5147A01q7_83515447102]62:7>01828364:" #(compile-sym
emit load0 load1 loadt loadnil void? loadvoid fits-i8 loadi8 loadv aset! compile-aset! in-env?
compile-app quote self-evaluating? compile-in if compile-if begin compile-begin prog1
-mpile-app quote self-evaluating? compile-in if compile-if begin compile-begin prog1
- compile-prog1 λ call-with-values #fn("n070AF62:" #(compile-f-))
+mpile-app quote self-evaluating? compile-in if compile-if begin compile-begin prog1
+ compile-prog1 λ call-with-values #fn("n070AF62:" #(compile-f-))
F62:" #(compile-f-))
#fn("n270A21053413K02223AF>2152470A242515163:q:" #(emit loadv #fn(for-each)
#fn("n170AF0q64:" #(compile-sym)) closure #fn(length)))
@@ -324,7 +324,7 @@
52@30q42386A<74051152e3:750517605170051718851F<86512728798:52152893E088=?847287898653@30q42723e18792<868;52Pe193<888;5263:" #(cddr
value-get-doc sym-set-doc def caddr cdadr caadr #fn(nconc)
#fn(map) list) expand-define) #fn("n20T20A<71051222324F1>2865215252P:" #(begin cddr #fn(nconc)
-P:" #(begin cddr #fn(nconc)
+P:" #(begin cddr #fn(nconc)
#fn("n10<70A<0TF525150Fe3:" #(compile-thunk))) expand-let-syntax)
#fn("n20:" #() local-expansion-env) #fn("n20H3400:0<208615221A10>3873P087=B3I0A<87T0=f2F<72875115262:73051893>0A<890=f2162:87;J?0486RS;J60486Z3708860:8624C400:8625C:092<0162:8625C:092<0162:8626C:093<0162:8627C:094<0162:8860:" #(#fn(assq)
#fn("n0Ib48420AF84>3_484<^19261:" #(#fn("n10H3400:0<H3700<@90A<0<F5292<0=51P:" #()))) caddr
@@ -401,7 +401,7 @@
(table)
#fn(put!)) putprop)
quote-value #fn("n1700513400:210e2:" #(self-evaluating? quote) quote-value) quoted?
-t?)
+t?)
read-all #fn("n17071062:" #(read-all-of read) read-all) read-all-of
#fn("n2Ib686201860>3_486<^1q015162:" #(#fn("n220A5138071061:F<10P92A5162:" #(#fn(io-eof?)
reverse!))) read-all-of)
--- a/src/builtins.c
+++ b/src/builtins.c
@@ -175,7 +175,7 @@
{
argcount(nargs, 2);
sl_sym *sym = tosym(args[0]);
- if(!isconstant(sym))
+ if(!isconst(sym))
sym->binding = args[1];
return args[1];
}
@@ -184,7 +184,7 @@
{
argcount(nargs, 1);
sl_sym *sym = tosym(args[0]);
- if(!isconstant(sym))
+ if(!isconst(sym))
sym->binding = UNBOUND;
return sl_void;
}
@@ -206,11 +206,11 @@
}
sl_purefn
-BUILTIN("constant?", constantp)
+BUILTIN("const?", constp)
{
argcount(nargs, 1);
if(issym(args[0]))
- return isconstant((sl_sym*)ptr(args[0])) ? sl_t : sl_nil;
+ return isconst((sl_sym*)ptr(args[0])) ? sl_t : sl_nil;
if(iscons(args[0])){
if(car_(args[0]) == sl_quote)
return sl_t;
--- a/src/compiler.lsp
+++ b/src/compiler.lsp
@@ -193,7 +193,7 @@
(def (compile-sym g env s deref)
(let ((loc (lookup-sym s env 0)))
(cond ((eq? loc 'global)
- (if (and (constant? s)
+ (if (and (const? s)
(printable? (top-level-value s)))
(emit g 'loadv (top-level-value s))
(emit g 'loadg s)))
--- a/src/sl.h
+++ b/src/sl.h
@@ -150,7 +150,7 @@
sy->flags |= FLAG_CONST; \
sy->binding = (v); \
}while(0)
-#define isconstant(s) ((s)->flags & FLAG_CONST)
+#define isconst(s) ((s)->flags & FLAG_CONST)
#define iskeyword(s) ((s)->flags & FLAG_KEYWORD)
#define sym_value(s) (((sl_sym*)ptr(s))->binding)
#define sym_to_numtype(s) (((sl_sym*)ptr(s))->numtype)
--- a/src/system.lsp
+++ b/src/system.lsp
@@ -543,7 +543,7 @@
(and (not (gensym? x))
(or (and (atom? x)
(not (sym? x)))
- (and (constant? x)
+ (and (const? x)
(sym? x)
(eq? x (top-level-value x))))))
@@ -1355,7 +1355,7 @@
(let* ((syms
(filter (λ (s)
(and (bound? s)
- (not (constant? s))
+ (not (const? s))
(or (not (builtin? (top-level-value s)))
(not (equal? (str s) ; alias of builtin
(str (top-level-value s)))))
--- a/src/vm.h
+++ b/src/vm.h
@@ -849,7 +849,7 @@
assert(issym(v));
sl_sym *sym = ptr(v);
v = sp[-1];
- if(!isconstant(sym))
+ if(!isconst(sym))
sym->binding = v;
NEXT_OP;
}