Skip to content
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

[DOC] Document Marshal#load parameter freeze: #5332

Merged
merged 1 commit into from
Dec 24, 2021

Conversation

zverok
Copy link
Contributor

@zverok zverok commented Dec 23, 2021

Screenshot:
image

@zverok
Copy link
Contributor Author

zverok commented Dec 23, 2021

@byroot Please review

marshal.rb Outdated Show resolved Hide resolved
@nobu nobu added the Documentation Improvements to documentation. label Dec 24, 2021
Comment on lines +19 to +31
# serialized = Marshal.dump(['value1', 'value2', 'value1', 'value2'])
#
# deserialized = Marshal.load(serialized)
# deserialized.map(&:frozen?)
# # => [false, false, false, false]
# deserialized.map(&:object_id)
# # => [1023900, 1023920, 1023940, 1023960] -- 4 different objects
#
# deserialized = Marshal.load(serialized, freeze: true)
# deserialized.map(&:frozen?)
# # => [true, true, true, true]
# deserialized.map(&:object_id)
# # => [1039360, 1039380, 1039360, 1039380] -- only 2 different objects, object_ids repeating
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines seem indented more than above call-seq, intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, no. Updated

@zverok zverok requested a review from nobu December 24, 2021 08:54
@byroot byroot merged commit 1706d1a into ruby:master Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
Development

Successfully merging this pull request may close these issues.

3 participants