有没有一种方法,我可以把head看作一个列表,就像tail一样,所以列表中的"one“和"a”出现在哪里都无关紧要?def reduc(list: List[String]): List[String] = { case "one" :: "a" :: tail => reduc(tail)
case head :: "one" :: "a" :: <em
我把我的答案放在findall的列表中,这个列表叫做答案。现在答案可以有0、1或更多项。1个答案,我可以用display_answer (X)来解决。罗洛夫% Displays the output of siblings(X,Y) and takes care that display_siblings(Person) :-