1%-----------------------------------------------------------------------------% 2% vim: ft=prolog ts=4 sw=4 et wm=0 tw=0 3%-----------------------------------------------------------------------------% 4:- module(evil, [ '...'//0, 5 if/2, op(1175, xfx, if), 6 not/1, op(1175, yf, not), 7 unless/2, op(1175, xfx, unless) ]). 8:- meta_predicate (if ) . 9:- meta_predicate (not) . 10:- meta_predicate (unless ) .
40:- multifile license:license/3. 41licencelicense(wtfpl, lgpl, 42 [ comment('Do What The Fuck You Want To Public License'), 43 url('http://www.wtfpl.net/txt/copying')]). 44:- license(wtfpl).
(
Condition -> True_path ; False_path )
was boringly easy to read and reason
about? Worry no longer with the patented tail-placed negating conditional!
Amaze your friends by saying things like this:
write('I like evil!'), nl unless 1 = 2.
Your friends will respect your ability to render their lives devoid of meaning (at least while they read your code).
65Term unless Condition :-
66 ( \+ call(Condition) -> call(Term) ).
(
Condition -> True_path ; False_path )
was boringly easy to read and reason
about? Worry no longer with the patented tail-placed conditional! Amaze
your friends by saying things like this:
write('I like evil!'), nl if 1 = 1.
Your friends will respect your ability to render their lives devoid of meaning (at least while they read your code).
87Term if Condition :-
88 ( call(Condition) -> call(Term) ).
file_contains(File, Pattern) :- phrase_from_file((..., Pattern, ...), File).
Amaze your friends with executing code that looks like it has meta-syntactic expressions in it! Make lots of friends and influence lots of people!
110... --> []|[_],... .
== 1=2 not. % true 1=1 not. % false 1=1, 2=2, 3=3, 4=4 not. % false 1=1, 2=2, 3=3, 4=3 not. % true
129Term not :-
130 \+ call(Term)
Evil Prolog
This module is intended to further the cause of Evil in the Prolog community. It accomplishes this by providing predicates that will render code difficult (and even impossible!) to follow even while retaining correctness.
It is no accident that many of these examples of evil come from mimicking other programming languages...
So signal your alliegance proudly with a
use_module(evil).
at the head of your code. Take a stand. For evil.