3 ms·
There is a certain pleasing physicality to function notion, in the sense that empty parens make a circle into which you put things. () -> (1). Look, I put a 1 i
by javajosh 11y ago
There is a certain pleasing physicality to function notion, in the sense that empty parens make a circle into which you put things. () -> (1). Look, I put a 1 in there! f(x) is a notation that is strictly speaking only good for the author of f because they know how to access their independent data; any utility to the caller, by inferring what "x" should be, is purely conventional/accidental.
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.
- thaumasiotes 11y ago> There is a certain pleasing physicality to function notion, in the sense that empty parens make a circle into which you put things. () -> (1). Look, I put a 1 in there! 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.
- taeric 11y agoDoesn't matter. Often affordances are only relevant to get you thinking at the start. Once a concept is fully established, the affordance no longer matters. 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.
- javajosh 11y agoI didn't talk about how to implement (or represent) the body of the function! And besides, Church seemed to like single arguments, so actually he would write something like that. :) 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}