f(x)=2x+1
In Q is
f:{1+2*x}
You could call it with: f 5 or f[5]. It’s really not any different.
Otoh, I'm still considering working through advent of code - such domains should be well suited, I guess.
For advent of code, it really shines though. Read in some big chunk of data, do a bunch of matrix and list operations to get the answer.
To be clear, a little language pride is always warranted :-)
Other than that, I find it a bit funny that the factorial function is singled out as an example of why naming (short) functions are redundant - seeing as how it's one of the first "complex" functions/operands thaught/named in mathematics, and heavily used to shorten notation for for example combinatorics (that is "n!").
But I think this just reflects on the (for me) somewhat alien culture of array languages - its not wrong, but it is different.
Well, yes. But we're taught infix notation early (x+y), and function application quite early too (y=f(x) - and in combiation (also note short-hand eliding multiplication): f(x) = 2x + 1).
I still find array languages to be too dense for me - but I do understand that they are simple from a certain point of view.