About a Prolog tokenizer
问题 One of my assignments ask us to build a prolog tokenizer. Right now I wrote a predicate that can change space and tab it new line. But I don't know how to implement that into the main program. The replace part looks like this: replace(_, _, [], []). replace(O, R, [O|T], [R|T2]):- replace(O, R, T, T2). replace(O, R, [H|T], [H|T2]) :- H \= O, replace(O, R, T, T2). And the Main part has a predicate called removewhite(list1 list2) So how can I let removewhite execute replace? 回答1: You are a bit