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...
:- initialization((
stdin_to_codes(Codes),
text_to_expression(Codes, Expr),
- write_term(Expr, [quoted(true)]), print('\n')
+ write_term(Expr, [quoted(true)]), print('.\n')
)).
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')
)).
:- 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')
)).