Nix Documentation | 403 Members | |
| Discussion about documentation improvements around the Nix ecosystem | 83 Servers |
| Sender | Message | Time |
|---|---|---|
| 30 Apr 2024 | ||
| You can shadow a name but that's not really the value changing. | 12:36:59 | |
| Yes thats where my question is coming from. | 12:41:43 | |
| x = 2 x is 3let x = 5; in x x stays 3 | 12:42:20 | |
| Uh formatting.. sorry. So assingment is said as convention in nix? | 12:42:49 | |
| I wouldn't say it's a Nix convention per se. More of a general programmer's convention. | 12:44:21 | |
| I also wouldn't worry about it much but maybe that's just me. | 12:46:45 | |
| Yeah I was curious because its used in the nix tutorial. | 13:01:18 | |
* | 13:02:23 | |
| * 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 | |
| Correct me if I'm wrong, my understanding is rather superfluous unlike some here, so just please make sure I didn't put out any misinformation please | 17:31:51 | |
| * 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:32:58 | |
| Also by they way that whole purity thing pricatically makes functional programs so easy to navigate in code, if you have something in some function it means it was propagated there through its arguments, and you can just find the called, and the further caller etc, no nothing gets inside from some global space that is sooo convenient, functional style is sooooo convenient | 17:39:37 | |
| * Also by they way that whole purity thing pricatically makes functional programs so easy to navigate in code, if you have something in some function it means it was propagated there through its arguments, and you can just find the caller, and the further caller etc, no nothing gets inside from some global space that is sooo convenient, functional style is sooooo convenient | 17:39:57 | |
| 22:05:55 | ||
| 1 May 2024 | ||
| 15:06:26 | ||
| 2 May 2024 | ||
| 17:16:19 | ||
| 20:42:00 | ||
| 21:19:12 | ||
| 3 May 2024 | ||
| I have a question about possible reordering of sections? I'm doing the nix language tutorial and its about this: After the https://nix.dev/tutorials/nix-language#attribute-set-argument comes the default value part section, followed by the additional attributes part. Why is default value part between? Perhaps the additional attributes part would make more sense right after the attribute set argument because it effectively addresses the counterexample by introducing the ellipsis? As stated in the additional attributes part: Unlike in the previous counter-example, passing an argument that contains additional attributes is not an error. | 08:55:30 | |
In reply to @stablejoy:matrix.orgSure, doesn’t sound wrong. I don’t have a strong preference here, feel free to make a suggestion that reads somewhat fluently. :) | 09:06:39 | |
In reply to @stablejoy:matrix.orgThat’s helpful insight. I chose “assign” because it’s not just programmer jargon but also makes sense in everyday life. You “assign someone to a task”, things like that. You wouldn’t “bind a task to someone”. | 09:11:41 | |
In reply to @fricklerhandwerk:matrix.orgOh. I guess you could assign a task to someone who is bound by oath to you | 10:21:07 | |
| I think the point is more that "to assign" is more commonly understood than "to bind." | 10:36:08 | |