OSDN Git Service

SWIProlog can't not emit '.'.
authorsforman <sforman@hushmail.com>
Thu, 3 Aug 2023 05:38:04 +0000 (22:38 -0700)
committersforman <sforman@hushmail.com>
Thu, 3 Aug 2023 05:38:04 +0000 (22:38 -0700)
I would like the GNU Prolog and SWI Prolog versions to be compatible, if
possible.

SWI has bigints, GNU doesn't, so that's a wrinkle...

implementations/GNUProlog/parser.prolog
implementations/GNUProlog/printer.prolog
implementations/GNUProlog/thun.prolog
implementations/SWIProlog/eval_joy_ast [deleted file]

index 46aa34d..716c289 100644 (file)
@@ -87,5 +87,5 @@ stdin_to_codes(Code, [Code|Codes]) :-
 :- initialization((
     stdin_to_codes(Codes),
     text_to_expression(Codes, Expr),
-    write_term(Expr, [quoted(true)]), print('\n')
+    write_term(Expr, [quoted(true)]), print('.\n')
     )).
index c873ad0..b8a4d6e 100644 (file)
@@ -17,7 +17,7 @@ codes_to_stream([Code|Codes], Stream) :-
 codes_to_stream([], _).
 
 :- initialization((
-    read_term(AST, [end_of_term(eof)]),
+    read_term(AST, []),
     format_joy_terms(AST, Codes, []),
     codes_to_stream(Codes, user_output), print('\n')
     )).
index 2f1dc17..1ee49f8 100644 (file)
@@ -66,8 +66,8 @@ combo(loop, [list(B),  bool(true)|S], S, Ei, Eo) :- append(B, [list(B), symbol(l
 
 
 :- initialization((
-    read_term(AST, [end_of_term(eof)]),
+    read_term(AST, []),
     thun(AST, [], Stack),
-    write_term(Stack, [quoted(true)]), print('\n')
+    write_term(Stack, [quoted(true)]), print('.\n')
     )).
 
diff --git a/implementations/SWIProlog/eval_joy_ast b/implementations/SWIProlog/eval_joy_ast
deleted file mode 100755 (executable)
index ea19de5..0000000
Binary files a/implementations/SWIProlog/eval_joy_ast and /dev/null differ