| 11 Dec 2025 |
Rutile (rootile) | well, i just did | 19:54:23 |
Charles | that's getting parsed as one minus the value stored in the variable a minus one | 19:54:23 |
Charles | you set a to 0 | 19:54:29 |
Charles | wait | 19:54:37 |
Charles | no i'm confused | 19:54:41 |
Rutile (rootile) | i set a to 1 | 19:54:44 |
Rutile (rootile) | and 1-a to 0 | 19:54:48 |
Charles | oh then i'm not confused and you're wrong | 19:55:10 |
Charles | this is just 1 minus 1 minus 1 | 19:55:28 |
Rutile (rootile) | okay yeah | 19:55:59 |
Rutile (rootile) | forgot that i set a | 19:56:04 |
Charles | because a is parsed as a variable containing 1 | 19:56:04 |
Charles | everything in the screenshots is explained by this plus "quoted variables can be set but not accessed unless it's an attrset key in which case you can use attrset."foo" to access the value for that key" | 19:58:03 |
aloisw | You can also put it into an attrset using "inherit". | 20:01:50 |
Charles | oh that's clever | 20:14:33 |
Qyriad | In reply to @commentator2.0:elia.garden sent an image. imo Nixlang2: we simply always require spaces around subtraction | 20:14:34 |
Charles | nix-repl> "1" = 2
Added "1".
nix-repl> {inherit "1";}."1"
2
| 20:14:48 |
Rutile (rootile) | Nixlang2 should just forbid - in identifiers /hj | 20:15:30 |
Qyriad | disagree | 20:15:37 |
piegames | horrors agree ^^ | 20:15:56 |
Qyriad | hyphens in identifiers is good actually, particularly for a package manager | 20:15:59 |
piegames | At the very least I think unary negation without parentheses should be deprecated | 20:16:18 |
Charles | so like just bias towards assuming no spaces means the whole thing is an identifier? | 20:16:21 |
Qyriad | yep | 20:16:33 |
Charles | interesting | 20:16:47 |
aloisw | NO | 20:16:52 |
Qyriad | subtraction is moderately rare in Nixlang code! i think this is a 100% fine syntactic tradeoff for the DSL | 20:17:08 |
Rutile (rootile) | thats why snake_case exists | 20:17:25 |
Qyriad | with hyphens in identifiers we can name variables like package names | 20:17:46 |
aloisw | And while at that, maybe reusing the string syntax for variable declaration was not so great either. Maybe spicy string literals could help here. | 20:18:17 |