nix icon indicating copy to clipboard operation
nix copied to clipboard

`__curPos` keyword is undocumented

Open roberth opened this issue 1 year ago • 3 comments

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

Priorities

Add :+1: to issues you find important.

roberth avatar Feb 19 '24 08:02 roberth

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

pennae avatar Feb 19 '24 13:02 pennae

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

roberth avatar Feb 20 '24 13:02 roberth

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:

pennae avatar Feb 20 '24 14:02 pennae

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.

roberth avatar Feb 28 '24 02:02 roberth