Skip to content
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

PrepareCalendarFields: Consider merging "calendarFieldNames" and "nonCalendarFieldNames" parameters into a single parameter #3001

Closed
anba opened this issue Oct 7, 2024 · 2 comments
Assignees
Labels
editorial spec-text Specification text involved

Comments

@anba
Copy link
Contributor

anba commented Oct 7, 2024

Without user-defined calendars it's probably no longer necessary to have separate calendarFieldNames and nonCalendarFieldNames parameters which later get merged anyway. And passing additional field names to CalendarExtraFields shouldn't matter, because this operation is now completely implementation-defined.

Also maybe consider sorting the field names when calling PrepareCalendarFields into the natural order instead sorting alphabetically. IMO this improves readability.

Currently in Temporal.PlainDateTime.prototype.with:

« day, month, month-code, year », « hour, microsecond, millisecond, minute, nanosecond, second »

When using a single list and sorting the field names per Table 20:

« year, month, month-code, day, hour, minute, second, millisecond, microsecond, nanosecond »

At least to me, the latter is easier to read.

And maybe consider moving PrepareCalendarFields into ch. "12 Calendars" instead of "13 Abstract Operations"?

@ptomato ptomato self-assigned this Oct 8, 2024
@ptomato ptomato added spec-text Specification text involved editorial labels Oct 8, 2024
@ptomato
Copy link
Collaborator

ptomato commented Oct 8, 2024

I'm not convinced about merging calendarFieldNames and nonCalendarFieldNames. I don't want to imply that CalendarExtraFields should be able to have its behaviour depend on nonCalendarFieldNames, even if it is now only for builtin calendars.

The other stuff, sounds good.

ptomato added a commit that referenced this issue Oct 8, 2024
…rder

It's easier to inspect at a glance which fields are included when they are
given in order. This order is not observable because the list is sorted
by lexicographical order anyway before being used to access properties.

See: #3001
ptomato added a commit that referenced this issue Oct 8, 2024
…rder

It's easier to inspect at a glance which fields are included when they are
given in order. This order is not observable because the list is sorted
by lexicographical order anyway before being used to access properties.

See: #3001
Ms2ger pushed a commit that referenced this issue Oct 8, 2024
…rder

It's easier to inspect at a glance which fields are included when they are
given in order. This order is not observable because the list is sorted
by lexicographical order anyway before being used to access properties.

See: #3001
Ms2ger pushed a commit that referenced this issue Oct 8, 2024
…rder

It's easier to inspect at a glance which fields are included when they are
given in order. This order is not observable because the list is sorted
by lexicographical order anyway before being used to access properties.

See: #3001
Ms2ger pushed a commit that referenced this issue Oct 8, 2024
…rder

It's easier to inspect at a glance which fields are included when they are
given in order. This order is not observable because the list is sorted
by lexicographical order anyway before being used to access properties.

See: #3001
@ptomato
Copy link
Collaborator

ptomato commented Oct 8, 2024

Closed in #3004.

@ptomato ptomato closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial spec-text Specification text involved
Projects
None yet
Development

No branches or pull requests

2 participants