Skip to content

Commit 6ff1512

Browse files
remove old code and reorganize
1 parent d6190e4 commit 6ff1512

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

ulisp.hpp

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const char wifistream[] = "wifi";
137137
const char stringstream[] = "string";
138138
const char gfxstream[] = "gfx";
139139
const char* const streamname[] = {serialstream, i2cstream, spistream, sdstream, wifistream, stringstream, gfxstream};
140-
enum stream { SERIALSTREAM, I2CSTREAM, SPISTREAM, SDSTREAM, WIFISTREAM, STRINGSTREAM, GFXSTREAM};
140+
enum stream { SERIALSTREAM, I2CSTREAM, SPISTREAM, SDSTREAM, WIFISTREAM, STRINGSTREAM, GFXSTREAM};
141141

142142
// Typedefs
143143

@@ -199,6 +199,7 @@ size_t Freespace = 0;
199199
object* Freelist;
200200
builtin_t Context;
201201

202+
object* tee;
202203
object* GlobalEnv;
203204
object* GCStack = NULL;
204205
object* GlobalString;
@@ -221,7 +222,6 @@ enum flag { PRINTREADABLY, RETURNFLAG, ESCAPE, EXITEDITOR, LIBRARYLOADED, NOESC,
221222
volatile flags_t Flags = 1; // PRINTREADABLY set by default
222223

223224
// Forward references
224-
object* tee;
225225
bool builtin_keywordp (object*);
226226
bool keywordp (object*);
227227
void pfstring (const char*, pfun_t);
@@ -898,7 +898,7 @@ int isbuiltin (object* obj, builtin_t n) {
898898
return symbolp(obj) && obj->name == sym(n);
899899
}
900900

901-
bool builtinp (symbol_t name) {
901+
inline bool builtinp (symbol_t name) {
902902
return (untwist(name) >= BUILTINS);
903903
}
904904

@@ -2363,29 +2363,6 @@ void superprint (object* form, int lm, pfun_t pfun) {
23632363
}
23642364
}
23652365

2366-
/*
2367-
supersub - subroutine used by pprint
2368-
*/
2369-
void supersub (object* form, int lm, int super, pfun_t pfun) {
2370-
int special = 0, separate = 1;
2371-
object* arg = car(form);
2372-
if (symbolp(arg) && builtinp(arg->name)) {
2373-
minmax_t minmax = getminmax(builtin(arg->name));
2374-
if (minmax == MINMAX(SPECIAL_FORMS, 2, UNLIMITED) || minmax == MINMAX(SPECIAL_FORMS, 1, 3)) special = 2; // defun, setq, setf, defvar
2375-
else if (minmax == MINMAX(SPECIAL_FORMS, 1, UNLIMITED) || minmax == MINMAX(OTHER_FORMS, 1, UNLIMITED) || minmax == MINMAX(SPECIAL_FORMS, 2, 3)) special = 1;
2376-
}
2377-
while (form != NULL) {
2378-
if (atom(form)) { pfstring(" . ", pfun); printobject(form, pfun); pfun(')'); return; }
2379-
else if (separate) { pfun('('); separate = 0; }
2380-
else if (special) { pfun(' '); special--; }
2381-
else if (!super) pfun(' ');
2382-
else { pln(pfun); indent(lm, ' ', pfun); }
2383-
superprint(car(form), lm, pfun);
2384-
form = cdr(form);
2385-
}
2386-
pfun(')'); return;
2387-
}
2388-
23892366
/*
23902367
edit - the Lisp tree editor
23912368
Steps through a function definition, editing it a bit at a time, using single-key editing commands.

0 commit comments

Comments
 (0)