If a define function f:{$[0=(x mod 2);1;0]}, I can only apply the function to atoms, e.g. f 3 will work but f til 9 will return `type. However, f each til 0 WILL work. In contrast, function neg WILL work on lists as well as atoms.
I understand this this due to the fact my user-defined function f is not atomic. Is there any way to make my function atomic? Also, how can I easily tell whether an existing function is atomic or not?
Ok, reading Jeff Borror’s book answered the question - because the $ operator is not atomic, it needs the each adverb to be applied to lists. So, to make my function atomic, I would do: