Whence function notation?
blogs.law.harvard.edu
blogs.law.harvard.edu
Function notion in this sense mirrors our counting system, which begins with an empty circle, 0, which we replace with a succession of symbols, until we hit 9, and then 10. It's interesting to imagine what "10" means if you're treating each symbol as a function. But this requires defining some sort of analog to "counting" with functions, which I'm not sure makes much sense in any general way. What is the "successor" to a function? It seems that we have a lot of options. One simple example would be to let f return a function based on an integer input, with the understanding that this is a simple function from 0-9 but then at 10 we return the composition of f_1 and f_0. In this way we describe the composition of 9 functions in any order using only a natural number.
Anyway, back to writing CRUD webapps.
This gets dropped as you go further in math, though. Take the function that reflects across the x,y plane, f(x,y,z) = (x,y,-z). Interpreting the notation your way, you'd want to write f((x,y,z)) = (x,y,-z), but that isn't done.
Consider the use of a disk to indicate that something can be saved. The fact that you no longer save to disk is ultimately irrelevant.
Physicists wouldn't (my degree is in physics).
Programmers would write f(x,y,z){return {x,y,-z};}. But actually, I would say that this is nasty because of asymmetry - it can't consume it's own output. f(p){return {p.x,p.y,-p.z}} where p = {x,y,z}
I'm aware that the semantic meaning of "f(x)" in most languages is function application—but I want to know what term I should use when, say, talking about how I wish in Ruby you could do "f(x)" with Procs, but are stuck instead with "f[x]".
We also don't generally pass functions around to other functions, and we don't care about syntax that much. After all, we are not computers, so we are quite comfortable changing syntax around according to habit and custom, even happily using ambiguous syntax when we think that our readers can figure out what we mean.
So, no. We don't have a common name for it because it's not an important distinction for us.
This makes sense mathematically as it's taken a long time for people to come around to thinking of functions as things in their own right. Dependent quantities are a more historical notion to my understanding.
Function argument parens are particularly weird when dealing with curried arguments. `f x y z` is so much nicer than `f(x)(y)(z)`.
a+b+c = (a+b)+c = a+(b+c) // Good!
f a b = (f a) b != f (a b) // WTF?
BTW, that's also a good rule of thumb for defining new operators. If your new op ~-^-~ is not associative, don't make it an op!! And even if it is, consider that users won't magically know the relative precedence of your op versus someone else's =^%^=. Looking at you, Haskell. a+b+c = (a+b)+c = a+(b+c) // Good!
f a b = (f a) b != f (a b) // WTF?
So, I suppose, also: a/b/c = (a/b)/c != a/(b/c) // WTF?
> BTW, that's also a good rule of thumb for defining new operators. If your new op ~-^-~ is not associative, don't make it an op!!Why should associativity be a requirement for a new op? Its not universal among common standard binary operators, after all (particularly division and exponentiation are not associative.)
The non-associativity of exponentiation does throw people off sometimes. Not all college students will correctly parse 2^2^2. IMO it's a wart in math notation. It could've been easily avoided by e.g. drawing a box around the exponent, so stacked exponentials would have boxes nesting upward.
Sure, for those two examples, but plenty of things that are typically written as operators in math aren't associative (× as the cross product, for instance, which gets bonus points for overloading a symbol that is an associative operator in other contexts.)
But then, this notation overloads the parenthesis, what is bad, and would make currying extremely annoying, basically killing the language.
Anyway, I disagree with you about operators. Some operations are just clearer when infixed, and there's no reason at all to expect a random operator to associative. Now, right associative operators are indeed something to use with care.
[1] http://math.stackexchange.com/questions/636332/the-origin-of...