3 ms·
I can rarely think of functions foo(arg) where I would like to pass either strings or numbers that uses an operator + which polymorphically concats or per
by wirrbel 13y ago
I can rarely think of functions
foo(arg)
where I would like to pass either strings or numbers that uses an operator + which polymorphically concats or performs addition. In this respect like languages that offer special string concatenating operators (like Haskell ++ or Lua with ..).
More generally: I think that + and * should always commute for the applied types and mixing them should follow the rules of associativity.