我正在实现一个递归函数,我希望停止条件是(2*scope),它是函数的参数
sortByManhattanDistance agent (2*scope) scope xs sortedNearFoodList = sortedNearFoodList
sortByManhattanDistance agent n scope xs sortedNearFoodList = sortByManhattanDistance agent (n+1) scope xs (sorted ++ sortedNearFoodList)
where sorted=compareManhattanDistance xs agent n
和拥抱抱怨:Syntax error in declaration (unexpected symbol "*")
这是否意味着我不能在参数上使用某些功能?
提前致谢