Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ The argument allows to provide the meta-information about the number of iteratio
# Provide a size when it is known beforehand:
linecount = `wc -l file.txt`.strip.to_i
f = File.open('file.txt')
e = Enumertor.produce(size: linecount) {
e = Enumerator.produce(size: linecount) {
raise StopIteration if f.eof?
f.readline
}
Expand Down Expand Up @@ -628,7 +628,7 @@ The current state of the concept is somewhat drafty/experimental, yet it lays th

### `Binding`: separate local variables from implicit parameters[](#binding-separate-local-variables-from-implicit-parameters)

`Binding#local_variables` method now exclude numbered (implicit) parameters, and methods like `#local_varaible_get` raise an error for those names. Instead, new method group `#implicit_parameters`/`#implicit_parameter_get`/`#implicit_parameter_defined?` was introduced to refer to both kinds of implicit parameters (numbered and `it`).
`Binding#local_variables` method now exclude numbered (implicit) parameters, and methods like `#local_variable_get` raise an error for those names. Instead, new method group `#implicit_parameters`/`#implicit_parameter_get`/`#implicit_parameter_defined?` was introduced to refer to both kinds of implicit parameters (numbered and `it`).

* **Reason:** It was decided, that exposing numbered parameters as "local variables" is confusing and misleading (say, you couldn't call `_1 = value`, but accidentally `binding.local_variable_set(:_1, value)` worked). So the concepts were separated.
* **Discussion:** <a class="tracker bug" href="https://bugs.ruby-lang.org/issues/21049">Bug #21049</a>
Expand Down Expand Up @@ -1001,7 +1001,7 @@ After introducing ports and removing generic `Ractor.yield`, `Ractor.select` now

#### Methods for waiting for a ractor[](#methods-for-waiting-for-a-ractor)

Instead of `#take`, there are now `#join` (wait till ractor ends its execution) and `#value` (`#join` + provide the return value), and also lower-level methdods `#monitor` and `#unmonitor` that provide `Port`-based abstractions to implement `#join` and alike methods.
Instead of `#take`, there are now `#join` (wait till ractor ends its execution) and `#value` (`#join` + provide the return value), and also lower-level methods `#monitor` and `#unmonitor` that provide `Port`-based abstractions to implement `#join` and alike methods.

* **Discussion:** —
* **Documentation:** <a class="ruby-doc" href="https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-join"><code>Ractor#join</code></a>, <a class="ruby-doc" href="https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-value"><code>#value</code></a>, <a class="ruby-doc" href="https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-monitor"><code>#monitor</code></a>, <a class="ruby-doc" href="https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-unmonitor"><code>#unmonitor</code></a>
Expand Down
6 changes: 3 additions & 3 deletions _src/4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ The argument allows to provide the meta-information about the number of iteratio
# Provide a size when it is known beforehand:
linecount = `wc -l file.txt`.strip.to_i
f = File.open('file.txt')
e = Enumertor.produce(size: linecount) {
e = Enumerator.produce(size: linecount) {
raise StopIteration if f.eof?
f.readline
}
Expand Down Expand Up @@ -628,7 +628,7 @@ The current state of the concept is somewhat drafty/experimental, yet it lays th

### `Binding`: separate local variables from implicit parameters

`Binding#local_variables` method now exclude numbered (implicit) parameters, and methods like `#local_varaible_get` raise an error for those names. Instead, new method group `#implicit_parameters`/`#implicit_parameter_get`/`#implicit_parameter_defined?` was introduced to refer to both kinds of implicit parameters (numbered and `it`).
`Binding#local_variables` method now exclude numbered (implicit) parameters, and methods like `#local_variable_get` raise an error for those names. Instead, new method group `#implicit_parameters`/`#implicit_parameter_get`/`#implicit_parameter_defined?` was introduced to refer to both kinds of implicit parameters (numbered and `it`).

* **Reason:** It was decided, that exposing numbered parameters as "local variables" is confusing and misleading (say, you couldn't call `_1 = value`, but accidentally `binding.local_variable_set(:_1, value)` worked). So the concepts were separated.
* **Discussion:** [Bug #21049](https://bugs.ruby-lang.org/issues/21049)
Expand Down Expand Up @@ -1001,7 +1001,7 @@ After introducing ports and removing generic `Ractor.yield`, `Ractor.select` now

#### Methods for waiting for a ractor

Instead of `#take`, there are now `#join` (wait till ractor ends its execution) and `#value` (`#join` + provide the return value), and also lower-level methdods `#monitor` and `#unmonitor` that provide `Port`-based abstractions to implement `#join` and alike methods.
Instead of `#take`, there are now `#join` (wait till ractor ends its execution) and `#value` (`#join` + provide the return value), and also lower-level methods `#monitor` and `#unmonitor` that provide `Port`-based abstractions to implement `#join` and alike methods.

* **Discussion:** —
* **Documentation:** [Ractor#join](https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-join), [#value](https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-value), [#monitor](https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-monitor), [#unmonitor](https://docs.ruby-lang.org/en/4.0/Ractor.html#method-i-unmonitor)
Expand Down