From f5ea447c9c6f1b3ddadc97dcb0057674b4dd0665 Mon Sep 17 00:00:00 2001 From: glenda Date: Sat, 10 Sep 2022 00:24:23 +0000 Subject: First step of a programmable session --- main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index d67d742..adcc662 100644 --- a/main.c +++ b/main.c @@ -7,6 +7,8 @@ #include "apl9.h" Biobuf *stdin; +static int booted = 0; +static Rune *startfile = L"runtime/start.apl"; void threadmain(int argc, char *argv[]) @@ -46,16 +48,22 @@ restart: goto restart; } + if(!booted){ + booted = 1; + Array *path = mkrunearray(startfile); + runfile(path); + freearray(path); + } + while(!off){ checkmem("main loop"); - if(needsnewline){ + /* if(needsnewline){ print("\n"); needsnewline = 0; - } - print("\t"); + } */ Datum *result = evalline(nil, stdin, 1); if(result && !result->shy) - print("%S\n", ppdatum(result)); + setquotequad(result); freedatum(result); /* print("Unfreed arrays: %d\n", arrayalloccounts); -- cgit v1.2.3