nix
nix copied to clipboard
`__curPos` keyword is undocumented
Problem
__curPos
keyword is undocumented
Proposal
Add to
- Language constructs
- Constants: a link to the subsection in Language consturcts, because readers might expect to find it there, even if it's not a constant but a keyword.
Related
- #7752
Checklist
- [x] checked latest Nix manual (source)
- [x] checked open documentation issues and pull requests for possible duplicates
Priorities
Add :+1: to issues you find important.
important semantic nitpicking: __curPos
is not a keyword, it is specific magic semantics for specifically the simple identifier __curPos
in specifically value position
Fair enough; that's how it's implemented.
Though it really should behave as a keyword.
-------- Original Message -------- On 19 Feb 2024, 14:54, pennae wrote:
important semantic nitpicking: __curPos is not a keyword, it is specific magic semantics for specifically the simple identifier __curPos in specifically value position
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Though it really should behave as a keyword.
disagreeing on that. in the current implementation it should behave like a magic identifier (cf $RANDOM
in bash), but in a hypothetical nix language revision it should indeed be a keyword. sadly we can't really change the current implementation without also changing observable behavior someone may be unknowingly relying on. :upside_down_face:
We could warn when it's used incorrectly. The right model is for it to be a keyword, even if it's not a implemented perfectly as a keyword for compatibility.