Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试对列表的所有元素进行简单的转换:
trans(X, M, Y):- Y is X*(-1) - M.
然后我在写:
maplist(trans, [1,2,3], NEW). 我得到一个只是一个true而不是一个新的列表..
maplist(trans, [1,2,3], NEW).
true
将值传递给参数,例如:
maplist(trans(5), [1,2,3], NEW)
Result: NEW = [-6, -7, -8]