How should I write a function to be used in Apply in Mathematica?
I am wondering how I can write a function to be used in the Apply function in Mathematica? For example, I want to trivially re-implement the Or function, I found the following Apply[(#1 || #2)&,{a,b,c}] is not okay since it only Or 'ed the first two elements in the list. Many thanks! This will work, no matter how many vars, and is a general pattern: Or[##]&, for example In[5]:= Or[##] & @@ {a, b, c} Out[5]= a || b || c However, in the case of Or , this is not good enough, since Or is HoldAll and short-circuiting - that is, it stops upon first True statement, and keeps the rest unevaluated.