Skip to content

Improve ImmutableDict doc#58360

Closed
rfritz wants to merge 10 commits intoJuliaLang:masterfrom
rfritz:imdictdoc
Closed

Improve ImmutableDict doc#58360
rfritz wants to merge 10 commits intoJuliaLang:masterfrom
rfritz:imdictdoc

Conversation

@rfritz
Copy link
Copy Markdown

@rfritz rfritz commented May 8, 2025

I had difficulty using the data structure based on the current version of the docs, so I gathered up what from experimentation, research on the Discourse site, and reading the code and wrote this.

rfritz added 3 commits May 8, 2025 11:58
I had difficulty using the data structure based on the current version of the docs, so I gathered up what from experimentation, research on the Discourse site, and reading the code and wrote this.
Fix whitespace errors
Remove tab.
@vtjnash vtjnash added the docs This change adds or pertains to documentation label May 8, 2025
Copy link
Copy Markdown
Member

@LilithHafner LilithHafner left a comment

Choose a reason for hiding this comment

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

Thanks for aggregating this and writing it up! It's good to have this documented.

This content is a little too tutorial style for a docstring, which is typically primarily for reference (i.e. concise, precise, and comprehensive specification of the behavior of an object). Perhaps you could put some of it in an "extended help" section (described here) to make the primary docstring a bit shorter.

base/dict.jl Outdated
@@ -778,14 +778,35 @@ end
"""
ImmutableDict
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
ImmutableDict
Base.ImmutableDict

base/dict.jl Outdated
Comment on lines +784 to +785
search of a linked list. `ImmutableDict` is `public` rather than
`export`; to access it one must write `Base.ImmutableDict`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This can be conveyed by example by using Base.ImmutableDict in the opening line

Suggested change
search of a linked list. `ImmutableDict` is `public` rather than
`export`; to access it one must write `Base.ImmutableDict`
search of a linked list.

base/dict.jl Outdated
Comment on lines +792 to +793
type of the dictionary elements; the returned value will be the head
of the list. To add to the dictionary use
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What does "the head of the list" mean?

base/dict.jl Outdated
Comment on lines +801 to +802
The types of elements may be specified; this is useful when keys or
values of `Union` or `Any` types are desired.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
The types of elements may be specified; this is useful when keys or
values of `Union` or `Any` types are desired.
The types of elements may be specified; this is useful when additional keys or values will be added that are not of the same type as the initial elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs This change adds or pertains to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants