f = method(Associative=>true) -- creates an associative method which will call upon the appropriate binary methods for its arguments two at a time.
In the following example we install a method which isn't associative to illustrate the order of evaluation.
i1 : f = method(Associative => true) |
i2 : f(String,String) := (i,j) -> "(" | i | ")," | j; |
i3 : f("a","b","c","d") |
See also: