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

Update the spec and primers for range and const changes #22565

Merged
merged 3 commits into from
Jun 16, 2023

Conversation

vasslitvinov
Copy link
Member

Update the Ranges and Domains and Coercions chapters of the spec and the comments in the ranges and other primers for the change range.stridable --> strides: strideKind in #22441, with follow-ons #22486 and #22508.

Also remove the remaining occurrences of BoundedRangeType from the spec and primers -- it is deprecated as of #22059.

Remove the const return and yield intent in the Procedures, Iterators, and Tuples sections of the spec -- it is unstable as of #22515. I did not see any need to update the primers for this change.

While there, I did some rephrasing and restructuring of the text for better readability or precision.

Testing: visual examination of the generated docs; a standard paratest.

Post-merge: update the Chapel Evolution document.

Signed-off-by: Vassily Litvinov <vasslitvinov@users.noreply.github.com>
Signed-off-by: Vassily Litvinov <vasslitvinov@users.noreply.github.com>
@@ -181,7 +177,7 @@ The syntax of a rectangular domain type is summarized as follows:
'domain' ( named-expression-list )

where ``named-expression-list`` permits the values of ``rank``,
``idxType``, and ``stridable`` to be specified using standard type
``idxType``, and ``strides`` to be specified using standard type
Copy link
Member

Choose a reason for hiding this comment

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

The previous grammar of "... using standard type signature" seems a bit odd here. I think we could just get rid of that and have the sentence end with "to be specified".

@@ -249,8 +244,8 @@ The type of a rectangular domain literal is defined as follows:

- ``idxType`` = the type of the range expressions;

- ``stridable`` = ``true`` if any of the range expressions are
stridable, otherwise ``false``.
- ``strides`` = the most specific value that accepts all the strides
Copy link
Member

Choose a reason for hiding this comment

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

Suggested rewording:

the most narrow :enum:strideKind that can represent all strides parameters of the range expressions.

The type of the resulting domain is the same as the original domain,
with the ``strides`` parameter adjusted to accept all the strides
that are accepted by the ``strides`` parameters of the resulting
domain's ranges.
Copy link
Member

Choose a reason for hiding this comment

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

If you make a change like the one I suggested above, you'll want to replicate that language here.

For example:

- If the base range has ``strides=strideKind.one`` and the step is
the literal ``-2``, the result has ``strides=strideKind.positive``.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be negative?

Copy link
Member Author

Choose a reason for hiding this comment

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

I started with one, so positive is definitely an improvement. :)

Signed-off-by: Vassily Litvinov <vasslitvinov@users.noreply.github.com>
@vasslitvinov vasslitvinov merged commit 3ff35de into chapel-lang:main Jun 16, 2023
@vasslitvinov vasslitvinov deleted the range-const-doc-updates branch June 16, 2023 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants