如何用另一个数字替换列表中的“x”?

How do I replace the `x` in a list with another number?

假设我有一个列表:

(1 34 -5 -6 -5 9)

对于长列表,如何将 -5 替换为 0

如果你想替换列表中的所有 -5,你可以使用类似的东西:

    list:(1 34 -5 -6 -5 9)     
    list[where list=-5]:0

这会给出

    1 34 0 -6 0 9

列出 a 并替换为 b a:1 2 3 -5 6 7; b:-5;

使用 amend at(@) 函数 @[a;a?b;:;0]