diff options
author | Marc-Andre Lafortune <[email protected]> | 2020-12-24 01:36:08 -0500 |
---|---|---|
committer | Marc-Andre Lafortune <[email protected]> | 2020-12-24 01:36:08 -0500 |
commit | 8aa299de24145891848ce50e29856d2275c75fd3 (patch) | |
tree | 519e3205bbbb1cb5981953d8cb3d3e184bb65e68 | |
parent | 8c510e4095458c783420ea0da86f9eedb139731d (diff) |
Tweak magic comments [doc]
-rw-r--r-- | doc/syntax/comments.rdoc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/syntax/comments.rdoc b/doc/syntax/comments.rdoc index b982732b76..650d13c2dc 100644 --- a/doc/syntax/comments.rdoc +++ b/doc/syntax/comments.rdoc @@ -178,22 +178,22 @@ In this mode, all values assigned to constants are made shareable. X = var # => calls `Ractor.make_shareable(var)` var.frozen? # => true -This mode is "experimental", because it might be error prone, for -example by deep-freezing the constants of an external resource which +This mode is "experimental", because it might be error prone, for +example by deep-freezing the constants of an external resource which could cause errors: # shareable_constant_value: experimental_everything FOO = SomeGem::Something::FOO # => deep freezes the gem's constant! -We will revisit to consider removing "experimental_" or removing this -mode by checking usages before Ruby 3.1. +This will be revisited before Ruby 3.1 to either allow `everything` +or to instead remove this mode. The method Module#const_set is not affected. ==== Mode +experimental_copy+ -In this mode, all values assigned to constants are copyied deeply and +In this mode, all values assigned to constants are deeply copied and made shareable. It is safer mode than +experimental_everything+. # shareable_constant_value: experimental_everything @@ -204,9 +204,9 @@ made shareable. It is safer mode than +experimental_everything+. Ractor.shareable?(X) #=> true var.object_id == X.object_id #=> false -This mode is "experimental", because it is not discussed enough. -We will revisit to consider removing "experimental_" or removing this -mode by checking usages before Ruby 3.1. +This mode is "experimental" and has not been discussed thoroughly. +This will be revisited before Ruby 3.1 to either allow `copy` +or to instead remove this mode. The method Module#const_set is not affected. @@ -224,7 +224,7 @@ This directive can be used multiple times in the same file: B.frozen? # => true B[:foo].frozen? # => true - C = [Object.new] # => cannot assign unshareable object to C (Ractor::Error) + C = [Object.new] # => cannot assign unshareable object to C (Ractor::IsolationError) D = [Object.new.freeze] D.frozen? # => true |