Re:On Scaling Mental Models
by AzzieElbab on Sunday March 22, 2020 @03:00PM
(#22657547)
Well, in Scala with default predef it would depend on the order or the arguments. If first one is a string it would just append string representation of the second one. One could use a random generator to guess what would happen in JavaScript. I do not know what Python does in these cases
Re:On Scaling Mental Models
by AzzieElbab on Sunday March 22, 2020 @05:51PM
(#22659038)
Sorry for being cryptic, the point was that I prefer appenders being explicitly documented in types or method signatures instead of some built-in magic
In a dynamically-typed language you’d get some kind of runtime error.
Just think of (+) like any other function and what would happen in your language if you call a function with types that the function doesn’t support.