continued formatting work

This commit is contained in:
Kyle Isom 2025-04-03 09:21:25 -07:00
parent 52debcf045
commit a3a83f692c
1 changed files with 38 additions and 17 deletions

View File

@ -2278,11 +2278,19 @@ builtinp(symbol_t name)
return (untwist(name) >= BUILTINS); return (untwist(name) >= BUILTINS);
} }
int checkkeyword (object *obj) { int
if (!keywordp(obj)) error("argument is not a keyword", obj); checkkeyword(object *obj)
{
if (!keywordp(obj)) {
error("argument is not a keyword", obj);
}
builtin_t kname = builtin(obj->name); builtin_t kname = builtin(obj->name);
uint8_t context = getminmax(kname); uint8_t context = getminmax(kname);
if (context != 0 && context != Context) error(invalidkey, obj); if (context != 0 && context !e Context) {
error(invalidkey, obj);
}
return ((int)lookupfn(kname)); return ((int)lookupfn(kname));
} }
@ -2290,21 +2298,34 @@ int checkkeyword (object *obj) {
checkargs - checks that the number of objects in the list args checkargs - checks that the number of objects in the list args
is within the range specified in the symbol lookup table is within the range specified in the symbol lookup table
*/ */
void checkargs (object *args) { void
checkargs(object *args)
{
int nargs = listlength(args); int nargs = listlength(args);
checkminmax(Context, nargs); checkminmax(Context, nargs);
} }
/* /*
eqlongsymbol - checks whether two long symbols are equal eqlongsymbol - checks whether two long symbols are equal
*/ */
bool eqlongsymbol (symbol_t sym1, symbol_t sym2) { bool
eqlongsymbol(symbol_t sym1, symbol_t sym2)
{
object *arg1 = (object *)sym1; object *arg2 = (object *)sym2; object *arg1 = (object *)sym1; object *arg2 = (object *)sym2;
while ((arg1 != NULL) || (arg2 != NULL)) { while ((arg1 != NULL) || (arg2 != NULL)) {
if (arg1 == NULL || arg2 == NULL) return false; if (arg1 == NULL || arg2 == NULL) {
if (arg1->chars != arg2->chars) return false; return false;
}
if (arg1->chars != arg2->chars) {
return false;
}
arg1 = car(arg1); arg2 = car(arg2); arg1 = car(arg1); arg2 = car(arg2);
} }
return true; return true;
} }