Nix Documentation | 422 Members | |
| Discussion about documentation improvements around the Nix ecosystem | 86 Servers |
| Sender | Message | Time |
|---|---|---|
| 30 Apr 2024 | ||
| * x = 2 x = 3 x is 3let x = 5; in x 5 x stays 3 | 13:08:54 | |
* | 13:09:35 | |
In reply to @toonn:matrix.orgOh I see now, its like describing two directions. The assignment is describing direction from value to variable and the binding from identifier to value? | 13:18:42 | |
| Yes. Though I'm not saying that is the only difference. | 13:32:52 | |
| 14:18:04 | ||
In reply to @toonn:matrix.orgThats very interesting | 15:30:20 | |
In reply to @stablejoy:matrix.org Also, sorry it's long, but in terms of basic lambda calculus thingies you don't get to have named functions or values at all, all you have is 1) functions that accept values (1 value to be precise) and that value being applied into the body of that function (that is the input value is substituted for the name inside the body as-is and the "head" of the function is plucked off, e.g. in So because all you do is apply something from the head into the body, basically you view programs in pure languages as humongous onion functions that take some input and propagate it somewhere deeper modifying it in only god knows what ways, as the program evaluates, with every outer level of that huge onion removed, some inner layers gets a variable bound further and further until in the end you're left with some final value where everything that can be applied was applied. What you see with named values (value being anything from a number to a function) is simply a programmer abstraction, you assign names to your values for pure convenience because in the end any such program can be rewritten without any names with only values as a bunch of functions and values nested inside each other, that is unlike the imperarive mindset where variables are used as storage spaces and not simply as names for values to be substituted So again, yes, you bind names to values so that you can effectively as a programmer use those values in a short and concise way, not to actually store anything in them | 17:31:19 | |
| * Also, sorry it's long, but in terms of basic lambda calculus thingies you don't get to have named functions or values at all, all you have is 1) functions that accept values (1 value to be precise) and that value being applied into the body of that function (that is the input value is substituted for the name inside the body as-is and the "head" of the function is plucked off, e.g. in So because all you do is apply something from the head into the body, basically you view programs in pure languages as humongous onion functions that take some input and propagate it somewhere deeper modifying it in only god knows what ways, as the program evaluates, with every outer level of that huge onion removed, some inner layers gets a variable bound further and further until in the end you're left with some final value where everything that can be applied was applied. What you see with named values (value being anything from a number to a function) is simply a programmer abstraction, you assign names to your values for pure convenience because in the end any such program can be rewritten without any names with only values as a bunch of functions and values nested inside each other, that is unlike the imperarive mindset where variables are used as storage spaces and not simply as names for values to be substituted So again, yes, you bind names to values so that you can effectively as a programmer use those values in a short and concise way, not to actually store anything in them | 17:31:34 | |