• R/O
  • SSH

Joypy: Commit

Main interpreter and library.


Commit MetaInfo

Revision20e9a0d2485cfe4d3f50aec02c46ec7d6b80225f (tree)
Time2019-08-13 13:08:17
AuthorSimon Forman <sforman@hush...>
CommiterSimon Forman

Log Message

assert_defs/1 got upset about not finding combo/5

Change Summary

Incremental Difference

diff -r b3344d468606 -r 20e9a0d2485c thun/thun.pl
--- a/thun/thun.pl Mon Aug 12 20:59:02 2019 -0700
+++ b/thun/thun.pl Mon Aug 12 21:08:17 2019 -0700
@@ -197,30 +197,6 @@
197197
198198
199199 /*
200-Definitions
201-*/
202-
203-joy_def(def(Def, Body)) --> symbol(Def), blanks, "==", joy_parse(Body).
204-
205-joy_def --> joy_def(Def), {ignore(assert_def(Def))}.
206-
207-joy_defs --> blanks, joy_def, blanks, joy_defs.
208-joy_defs --> [].
209-
210-assert_defs(DefsFile) :-
211- read_file_to_codes(DefsFile, Codes, []),
212- phrase(joy_defs, Codes).
213-
214-assert_def(def(Def, Body)) :-
215- \+ func(Def, _, _),
216- \+ combo(Def, _, _, _, _),
217- retractall(def(Def, _)),
218- assertz(def(Def, Body)).
219-
220-:- assert_defs("defs.txt").
221-
222-
223-/*
224200 Combinators
225201 */
226202
@@ -299,6 +275,30 @@
299275
300276
301277 /*
278+Definitions
279+*/
280+
281+joy_def(def(Def, Body)) --> symbol(Def), blanks, "==", joy_parse(Body).
282+
283+joy_def --> joy_def(Def), {ignore(assert_def(Def))}.
284+
285+joy_defs --> blanks, joy_def, blanks, joy_defs.
286+joy_defs --> [].
287+
288+assert_defs(DefsFile) :-
289+ read_file_to_codes(DefsFile, Codes, []),
290+ phrase(joy_defs, Codes).
291+
292+assert_def(def(Def, Body)) :-
293+ \+ func(Def, _, _),
294+ \+ combo(Def, _, _, _, _),
295+ retractall(def(Def, _)),
296+ assertz(def(Def, Body)).
297+
298+:- assert_defs("defs.txt").
299+
300+
301+/*
302302 Compiler
303303 */
304304
Show on old repository browser