• R/O
  • SSH

Joypy: Commit

Main interpreter and library.


Commit MetaInfo

Revision2c9153571ceec94355eaffe53cfdb9aa5ccc7cd4 (tree)
Time2019-07-22 06:13:48
AuthorSimon Forman <sforman@hush...>
CommiterSimon Forman

Log Message

Assert definitions as they are read.

Instead of building a list then asserting them all after parsing.

Change Summary

Incremental Difference

diff -r e82375b0d716 -r 2c9153571cee thun/thun.pl
--- a/thun/thun.pl Sun Jul 21 11:50:27 2019 -0700
+++ b/thun/thun.pl Sun Jul 21 14:13:48 2019 -0700
@@ -186,16 +186,12 @@
186186
187187 joy_def(def(Def, Body)) --> symbol(Def), blanks, "==", joy_parse(Body).
188188
189-joy_defs([Def|Defs]) --> blanks, joy_def(Def), blanks, joy_defs(Defs).
190-joy_defs([]) --> [].
191-
192-read_defs(DefsFile, Defs) :-
193- read_file_to_codes(DefsFile, Codes, []),
194- phrase(joy_defs(Defs), Codes).
189+joy_defs --> blanks, joy_def(Def), {assert_def(Def)}, blanks, joy_defs.
190+joy_defs --> [].
195191
196192 assert_defs(DefsFile) :-
197- read_defs(DefsFile, Defs),
198- forall(member(Def, Defs), assert_def(Def)).
193+ read_file_to_codes(DefsFile, Codes, []),
194+ phrase(joy_defs, Codes).
199195
200196 assert_def(def(Def, Body)) :-
201197 retractall(def(Def, _)),
Show on old repository browser