summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-08 21:23:02 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-11-08 21:36:08 +0100
commit7c63f85777e1a1effbe7b3e6a826ae21fff3033f (patch)
treee92ce5a3d3cb2c35a3d2fcbf259bd8b4f4bdd291
parent642bf87cfd30394d4440c531f22e61ecce5bc49d (diff)
downloadwbs-7c63f85777e1a1effbe7b3e6a826ae21fff3033f.tar.gz
wbs-7c63f85777e1a1effbe7b3e6a826ae21fff3033f.tar.bz2
wbs-7c63f85777e1a1effbe7b3e6a826ae21fff3033f.zip
pd_client: Use descriptive paramter names for byte_to_atom
And move byte_to_atom around.
-rw-r--r--pd_client.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/pd_client.pl b/pd_client.pl
index 8aaf93b..7b32e3a 100644
--- a/pd_client.pl
+++ b/pd_client.pl
@@ -13,10 +13,6 @@ launch(Module, StreamIn, StreamOut) :-
atom_concat('rules/', Module, Path), consult(Path),
do(StreamIn, StreamOut, Module, [], []).
-% -1 = EOF
-byte_to_atom(-1, e):-!.
-byte_to_atom(A, B):-name(B, [A]).
-
do(_, _, _, _, [e|_]) :- !.
do(StreamIn, StreamOut, Module, ModuleState, Hist) :-
call(Module, Hist, ModuleDecision, ModuleState, NewModuleState),
@@ -27,3 +23,7 @@ loop(StreamIn, StreamOut, Module, ModuleState, Hist) :-
get_code(StreamIn, ChoiceCode), byte_to_atom(ChoiceCode, Choice),
write(Choice),
do(StreamIn, StreamOut, Module, ModuleState, [Choice|Hist]).
+
+% -1 = EOF
+byte_to_atom(-1, e):-!.
+byte_to_atom(Byte, Atom):-name(Atom, [Byte]).