8000 Accepted: RFC for cell range syntax by felix-oq · Pull Request #112 · jvalue/jayvee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Accepted: RFC for cell range syntax #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 24, 2023
Merged

Accepted: RFC for cell range syntax #112

merged 3 commits into from
Jan 24, 2023

Conversation

felix-oq
Copy link
Contributor

RFC for the cell range syntax, extracted from #109.

This hopefully helps us to finalize the cell range syntax separately and afterwards concentrate on the remaining parts of the discussion.

@felix-oq felix-oq changed the title RFC for cell range syntax Discussion: RFC for cell range syntax Jan 23, 2023
@felix-oq felix-oq requested review from rhazn and georg-schwarz and removed request for rhazn January 23, 2023 15:14
Copy link
Contributor
@rhazn rhazn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@georg-schwarz
Copy link
Member
georg-schwarz commented Jan 23, 2023

Just a minor thing: We currently allow relative positioning from the top/left but not from the bottom/right. This might be handy for cases where e.g. unusable metadata sits at the bottom instead of at the top.

Thus, I suggest to introduce like Python a syntax to address this by negative values handling it like a ring structure. Not because I think it is good syntax, solely because I don't have a better idea.

range A1:A-2 would then define a range from the cell A2 to the second-last cell in column A.

range A1:-B1 would then define a range from cell A1 to the second-last cell on row 1.

@felix-oq
Copy link
Contributor Author

Good point @georg-schwarz.

range A1:A-2 would then define a range from the cell A2 to the second-last cell in column A.

I think there is a mistake in your example, it should be range A2:A-2, right?

Alternative proposal using numerical offsets

In my opinion, the syntax you propose is not so easy to understand, especially when using it with column letters (e.g. -F meaning the 5th last column and -A being equivalent to *). Thus, I'd propose the use of *, to explicitly indicate the last row / column, in combination with numerical offsets:

range A2:A(*-1) defines a range from the cell A2 to the second-last cell in column A.
range A1:(*-1)1 defines a range from the cell A1 to the second-last cell in row 1.

Syntactic sugar version for an entire row / column would be:

row *-1
column *-1

@rhazn
Copy link
Contributor
rhazn commented Jan 24, 2023

I think that syntax is very hard to read, I'd avoid including that until we have an actual problem. Especially with using -, I think it looks more like a range (A-1 looks like "A minus 1" to me, not "A to negative 1").

@georg-schwarz
Copy link
Member

I think there is a mistake in your example, it should be range A2:A-2, right?

Yeah, my bad :)

I think that syntax is very hard to read.

Maybe a neutral sign indicating "enumeration from top/right" is better.. e.g. !, ~.

I'd avoid including that until we have an actual problem.

I agree that we don't need to fully implement the RFC for the time being. But for the sake of the RFC it should be somehow discussed ;)

@rhazn
Copy link
Contributor
rhazn commented Jan 24, 2023

I'd avoid including that until we have an actual problem.

I agree that we don't need to fully implement the RFC for the time being. But for the sake of the RFC it should be somehow discussed ;)

Haha yeah, my point was I think we should talk about it and decide to not do it as part of the RFC with the reason that it adds to the complexity of syntax.

@felix-oq
Copy link
Contributor Author
felix-oq commented Jan 24, 2023

@georg-schwarz would it be fine for you to propose and discuss the syntax for selecting cells at the end in a future RFC? I can add it to the drawbacks of this current RFC and create an issue so it's documented.

@felix-oq felix-oq changed the title Discussion: RFC for cell range syntax Accepted: RFC for cell range syntax Jan 24, 2023
@felix-oq felix-oq merged commit afb0a63 into main Jan 24, 2023
@felix-oq felix-oq deleted the rfc-cell-range-syntax branch January 24, 2023 15:42
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0