NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
11.87k stars 1.46k forks source link

`__curPos` keyword is undocumented #10036

Open roberth opened 6 months ago

roberth commented 6 months ago

Problem

__curPos keyword is undocumented

Proposal

Add to

Related

Checklist

Priorities

Add :+1: to issues you find important.

pennae commented 6 months ago

important semantic nitpicking: __curPos is not a keyword, it is specific magic semantics for specifically the simple identifier __curPos in specifically value position

roberth commented 6 months ago

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: @.***>

pennae commented 6 months ago

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:

roberth commented 5 months ago

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.