-
Notifications
You must be signed in to change notification settings - Fork 163
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 spec from google/starlark-go #107
Conversation
laurentlb
commented
Sep 24, 2020
•
edited
Loading
edited
- document call argument evaluation order
- load statements create local bindings
- Rename "universe" to "predeclared"
- hash: allow only strings
- Add TOC
This aligns the spec with google/starlark-go#198
@@ -463,8 +463,7 @@ values include `None`, Booleans, numbers, and strings, and tuples | |||
composed from hashable values. Most mutable values, such as lists, | |||
and dictionaries, are not hashable, unless they are frozen. | |||
Attempting to use a non-hashable value as a key in a dictionary | |||
results in a dynamic error, as does passing one to the built-in | |||
`hash` function. | |||
results in a dynamic error. |
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 think the old text was correct (does that mean this change needs to flow in the other direction?).
Both hash
implementations accept only string, not list, say.
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 think that's correct.
The old text said it's an error to pass a non-hashable value to hash. This might be technically true, but that's irrelevant since hash accepts only strings. No need to mention hash
here.
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.
Oh, of course.
@@ -463,8 +463,7 @@ values include `None`, Booleans, numbers, and strings, and tuples | |||
composed from hashable values. Most mutable values, such as lists, |
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 noticed that the TOC that exists in Go spec has vanished from bazelbuild. Could you restore it?
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.
Done
(this aligns with the doc in google/starlark-go)