Modify error reporting a lil; words word.
This commit is contained in:
parent
f58f3b9959
commit
3751107a09
12
thun/thun.pl
12
thun/thun.pl
|
|
@ -104,7 +104,7 @@ thun([Unknown|E], Si, So) :-
|
||||||
damned_thing(Unknown),
|
damned_thing(Unknown),
|
||||||
write("wtf? "),
|
write("wtf? "),
|
||||||
writeln(Unknown),
|
writeln(Unknown),
|
||||||
So = [[Unknown|E]|Si].
|
So = [Unknown|E]-Si.
|
||||||
|
|
||||||
damned_thing(It) :-
|
damned_thing(It) :-
|
||||||
\+ literal(It),
|
\+ literal(It),
|
||||||
|
|
@ -144,6 +144,8 @@ literal(_=\=_).
|
||||||
Functions
|
Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
func(words, S, [Words|S]) :- words(Words).
|
||||||
|
|
||||||
func(cons, [A, B|S], [[B|A]|S]).
|
func(cons, [A, B|S], [[B|A]|S]).
|
||||||
func(swap, [A, B|S], [B, A|S]).
|
func(swap, [A, B|S], [B, A|S]).
|
||||||
func(dup, [A|S], [A, A|S]).
|
func(dup, [A|S], [A, A|S]).
|
||||||
|
|
@ -298,6 +300,14 @@ assert_def(def(Def, Body)) :-
|
||||||
:- assert_defs("defs.txt").
|
:- assert_defs("defs.txt").
|
||||||
|
|
||||||
|
|
||||||
|
words(Words) :-
|
||||||
|
findall(Name, clause(func(Name, _, _), _), Funcs),
|
||||||
|
findall(Name, clause(combo(Name, _, _, _, _), _), Combos, Funcs),
|
||||||
|
findall(Name, clause(def(Name, _), _), Words0, Combos),
|
||||||
|
list_to_set(Words0, Words1),
|
||||||
|
sort(Words1, Words).
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Compiler
|
Compiler
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue