From d6c75d4dd9bb4eb38e48b47def603911817775fc Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Thu, 22 Jan 2026 14:27:05 +0100 Subject: [PATCH 1/5] rfc(0021): draft rfc --- rfc/0021-sheet-row-access-syntax/README.md | 116 +++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 rfc/0021-sheet-row-access-syntax/README.md diff --git a/rfc/0021-sheet-row-access-syntax/README.md b/rfc/0021-sheet-row-access-syntax/README.md new file mode 100644 index 00000000..24e69dda --- /dev/null +++ b/rfc/0021-sheet-row-access-syntax/README.md @@ -0,0 +1,116 @@ + + +# RFC 0021: Sheet row access syntax + +| | | +|---|---| +| Feature Tag | `sheet-row-access-syntax` | +| Status | `DRAFT` | +| Responsible | `jrentlez` | + + +## Summary + +This RFC removes some unnecessary definitions of RFC 0020 regarding sheet row +access. + +## Motivation + +RFC 0020 definitions are unnecessarily complicated to users: +- `SheetRow` value type +- `[]` syntax + +## Explanation + +This is the current way of accessing the sheet values of a table row, as +specified in RFC 0020: + +```jayvee +transform Parser { + from row oftype SheetRow; + to coord oftype Coordinate; + + coord: { + x: asInteger row["x"], + y: asInteger row[2], + } +} +``` + +This syntax introduced two new concepts: +- `SheetRow` as a special value type. +- The `[]` syntax to access the values of a sheet row. + +This RFC attempts to replace these new concepts with existing ones + +### `Collection` replaces `SheetRow` + +Semantically, `SheetRow` is an array of strings, which is identical to the +already existing value type `Collection`. + +### `.` replaces `[]` + +This is a familiar syntax for accessing a collection. +But at a deeper level, `[]` is a function that takes a collection and a +"location" and returns the collection's value at the "location". + +Jayvee already has a concept for this, operators. +As a consequence, the `[]` syntax is replaced with the new binary operator `.`. + +```jayvee +coord: { + // Both notations (with and without spaces around `.`) are valid. + x: asInteger (row . "x"), + y: asInteger (row.2), +} +``` + +## Drawbacks + + + +## Alternatives + +### `.`'s name + +We could use a "speaking name" for `.` e.g. `cellInColumn`. + +Pros: + - If the name is well chosen, it's obvious what the operator does + +Cons: + - `cellInColumn` would be used very frequently, creating lots of visual + "noise". + - We are committing to the singular function of this operator and cannot + expand it in the future + +### `.` precedence + +`.` has the highest precedence out of all binary and ternary operators, but a +lower precedence than unary operators (RFC 0009). +This results in braces being necessary (see example above). +We could make an exception and give `.` the highest precedence out of all +operators, which would enable the following: + +```jayvee +someValue: { + x: asInteger row . "x", + y: asInteger row.2, + z: asInteger row."x", +} +``` + +## Possible Future Changes/Enhancements + +- We may be able to unify the `.` operator and the nested property access from + RFC 0018. From b4c53ffb1af6f96fcaaad68ac1f36a2b33e86a22 Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Thu, 22 Jan 2026 14:32:22 +0100 Subject: [PATCH 2/5] rfc(0021): remove repetitive language --- rfc/0021-sheet-row-access-syntax/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rfc/0021-sheet-row-access-syntax/README.md b/rfc/0021-sheet-row-access-syntax/README.md index 24e69dda..9661c678 100644 --- a/rfc/0021-sheet-row-access-syntax/README.md +++ b/rfc/0021-sheet-row-access-syntax/README.md @@ -32,7 +32,7 @@ RFC 0020 definitions are unnecessarily complicated to users: ## Explanation -This is the current way of accessing the sheet values of a table row, as +Below is the current way of accessing the sheet values of a table row, as specified in RFC 0020: ```jayvee @@ -51,16 +51,16 @@ This syntax introduced two new concepts: - `SheetRow` as a special value type. - The `[]` syntax to access the values of a sheet row. -This RFC attempts to replace these new concepts with existing ones +We replace these new concepts with existing ones. ### `Collection` replaces `SheetRow` Semantically, `SheetRow` is an array of strings, which is identical to the -already existing value type `Collection`. +existing value type `Collection`. ### `.` replaces `[]` -This is a familiar syntax for accessing a collection. +`row[2]` is a familiar syntax for accessing a collection. But at a deeper level, `[]` is a function that takes a collection and a "location" and returns the collection's value at the "location". From 96183a53108e7295feb133da17442966a5138316 Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Wed, 18 Feb 2026 09:41:40 +0100 Subject: [PATCH 3/5] rfc(0021): as discussed, keep the new `SheetRow` valuetype --- rfc/0021-sheet-row-access-syntax/README.md | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/rfc/0021-sheet-row-access-syntax/README.md b/rfc/0021-sheet-row-access-syntax/README.md index 9661c678..94f6d619 100644 --- a/rfc/0021-sheet-row-access-syntax/README.md +++ b/rfc/0021-sheet-row-access-syntax/README.md @@ -21,19 +21,17 @@ SPDX-License-Identifier: AGPL-3.0-only ## Summary -This RFC removes some unnecessary definitions of RFC 0020 regarding sheet row +This RFC removes an unnecessary definition of RFC 0020 regarding sheet row access. ## Motivation -RFC 0020 definitions are unnecessarily complicated to users: -- `SheetRow` value type -- `[]` syntax +The `[]` syntax introduced in RFC 0020 is a completely new concept to new users. ## Explanation -Below is the current way of accessing the sheet values of a table row, as -specified in RFC 0020: +Below is the current way of accessing the values of a sheet row, as specified +in RFC 0020: ```jayvee transform Parser { @@ -47,17 +45,6 @@ transform Parser { } ``` -This syntax introduced two new concepts: -- `SheetRow` as a special value type. -- The `[]` syntax to access the values of a sheet row. - -We replace these new concepts with existing ones. - -### `Collection` replaces `SheetRow` - -Semantically, `SheetRow` is an array of strings, which is identical to the -existing value type `Collection`. - ### `.` replaces `[]` `row[2]` is a familiar syntax for accessing a collection. From e190c3933289a9637092ab645aeca686d7cbb5d9 Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Thu, 19 Feb 2026 10:20:20 +0100 Subject: [PATCH 4/5] rfc(0021): resolve todo --- rfc/0021-sheet-row-access-syntax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfc/0021-sheet-row-access-syntax/README.md b/rfc/0021-sheet-row-access-syntax/README.md index 94f6d619..ea951586 100644 --- a/rfc/0021-sheet-row-access-syntax/README.md +++ b/rfc/0021-sheet-row-access-syntax/README.md @@ -64,7 +64,7 @@ coord: { ## Drawbacks - +- Parentheses may be mistaken as a function call ## Alternatives From eeac32860097b3f27c9333e89bd5396e3b4fc6fa Mon Sep 17 00:00:00 2001 From: Jonas Zeltner Date: Thu, 19 Feb 2026 11:21:20 +0100 Subject: [PATCH 5/5] rfc(0021): mark rfc as accepted --- rfc/0021-sheet-row-access-syntax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfc/0021-sheet-row-access-syntax/README.md b/rfc/0021-sheet-row-access-syntax/README.md index ea951586..ba7a4ab5 100644 --- a/rfc/0021-sheet-row-access-syntax/README.md +++ b/rfc/0021-sheet-row-access-syntax/README.md @@ -9,7 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only | | | |---|---| | Feature Tag | `sheet-row-access-syntax` | -| Status | `DRAFT` | +| Status | `ACCEPTED` | | Responsible | `jrentlez` |