Skip to content

Conversation

@shethaadit
Copy link
Contributor

@shethaadit shethaadit commented Dec 13, 2024

Summary

Fixed wordings in access-control doc for F#.

Fixes #41852


Internal previews

📄 File 🔗 Preview link
docs/fsharp/language-reference/access-control.md Access Control

@dotnetrepoman dotnetrepoman bot added this to the December 2024 milestone Dec 13, 2024
@dotnet-policy-service dotnet-policy-service bot added okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. community-contribution Indicates PR is created by someone from the .NET community. labels Dec 13, 2024
Copy link
Contributor

@psfinaki psfinaki left a comment

Choose a reason for hiding this comment

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

Nice, thank you! :)

@T-Gro
Copy link
Member

T-Gro commented Dec 16, 2024

From the same docs, this is where access specifiers make sense:
public, internal, and private can be applied to modules, types, methods, value definitions, functions, properties, and explicit fields.

Access control e.g. for a let x = 5 inside a function does not apply, since it will become a stack variable.

What is the real intention please?
Is it to cover functions inside other functions?

@BillWagner
Copy link
Member

Hi @shethaadit @T-Gro

Can you work on the resolution to the comment above? Do we need more work here?

@shethaadit
Copy link
Contributor Author

Hi @BillWagner, thank you for your comment.

@T-Gro, since @psfinaki has already approved the PR, not sure what should we change.

@T-Gro, could you provide your inputs?

The access specifier is put in front of the name of the entity.

If no access specifier is used, the default is `public`, except for `let` bindings in a type, which are always `private` to the type.
If no access specifier is used, the default is `public`, except for `let` bindings in a type or a function, which are always `private` to the type.
Copy link
Member

Choose a reason for hiding this comment

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

Let bindings inside a function will often become just stack values, which do not have any access modifier.
I would rather keep the original phrasing as it was.

If you want to expand on "functions declared within other functions", it should be its own sentence.

Copy link
Contributor Author

@shethaadit shethaadit Jan 3, 2025

Choose a reason for hiding this comment

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

Hi @psfinaki, could you please provide your inputs so we can close this?

Copy link
Contributor

Choose a reason for hiding this comment

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

@shethaadit I agree with the above. I approved the PR because it makes the docs better anyway but the @T-Gro's inputs are valid so if it's not much effort for you, I would also appreciate if you address those.

Sorry for this taking long, Xmas came in sight, hope we'll progress with this quickly now.

Thanks for your continuous efforts around F# docs!

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

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fsharp/svc okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

let bindings are private to a function

4 participants