Closed ahrtr closed 1 year ago
Changed items:
- The section
Module execution
has the same level asStatements
, both has the prefix "##", but it's just a sub item underStatements
. It seems not correct. So increasedModule execution
to +1 level.#name-resolution
is a wrong link, so replaced it with#built-in-constants-and-functions
.- The lambda example has wrong output, corrected.
- typo,
element
-->tuple
There might be another error in https://github.com/google/starlark-go/blob/master/doc/spec.md#lists , I am not quite sure about it and don't know how to update it. See below,
For most types, x += y is equivalent to x = x + y, except that it evaluates x only once, that is, it allocates a new list to hold the concatenation of x and y. However, if x refers to a list, the statement does not allocate a new list but instead mutates the original list in place, similar to x.extend(y).
My immediate feeling is that the
"it allocates a new list"
isn't correct. The following"However, if x refers to a list"
indicates that previous sentence is talking about most other types instead of list.
It's correct in that the current section is about lists, but I agree it could be clearer. How about:
For most types, `x += y` is equivalent to `x = x + y`, except that it
evaluates `x` only once. However, if `x` refers to a list, the statement
`x += y` does not allocate a new list as `x = x + y` would,
but instead mutates the original list in place, similar to `x.extend(y)`.
It's correct in that the current section is about lists, but I agree it could be clearer. How about:
For most types, `x += y` is equivalent to `x = x + y`, except that it evaluates `x` only once. However, if `x` refers to a list, the statement `x += y` does not allocate a new list as `x = x + y` would, but instead mutates the original list in place, similar to `x.extend(y)`.
Makes sense & updated & thx
Changed items:
Module execution
has the same level asStatements
, both has the prefix "##", but it's just a sub item underStatements
. It seems not correct. So increasedModule execution
to +1 level.#name-resolution
is a wrong link, so replaced it with#built-in-constants-and-functions
.element
-->tuple
There might be another error in https://github.com/google/starlark-go/blob/master/doc/spec.md#lists , I am not quite sure about it and don't know how to update it. See below,
My immediate feeling is that the
"it allocates a new list"
isn't correct. The following"However, if x refers to a list"
indicates that previous sentence is talking about most other types instead of list.