-
Notifications
You must be signed in to change notification settings - Fork 421
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
Update the spec and primers for range and const changes #22565
Conversation
Signed-off-by: Vassily Litvinov <vasslitvinov@users.noreply.github.com>
Signed-off-by: Vassily Litvinov <vasslitvinov@users.noreply.github.com>
doc/rst/language/spec/domains.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
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".
doc/rst/language/spec/domains.rst
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
doc/rst/language/spec/domains.rst
Outdated
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. |
There was a problem hiding this comment.
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.
doc/rst/language/spec/ranges.rst
Outdated
For example: | ||
|
||
- If the base range has ``strides=strideKind.one`` and the step is | ||
the literal ``-2``, the result has ``strides=strideKind.positive``. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
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.