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

Allow use on let bindings in classes #312

Closed
baronfel opened this issue Oct 20, 2016 · 4 comments
Closed

Allow use on let bindings in classes #312

baronfel opened this issue Oct 20, 2016 · 4 comments
Labels

Comments

@baronfel
Copy link
Contributor

baronfel commented Oct 20, 2016

Allow use on let bindings in classes [6337095]

Submitted by Mårten Rånge on 8/23/2014 12:00:00 AM
4 votes on UserVoice prior to migration

A common task in .NET is to implement is IDisposable.
I find the most common task is implementing IDisposable on a class that have fields that are subclasses of IDisposable and no unmanaged resources.
Implementing IDisposable is tedious and error prone. F# supports use on local bindings. Why not support it for member bindings as well?

Response

** by fslang-admin on 2/10/2016 12:00:00 AM **

Thanks for the suggestion. it’s definitely an interesting one and it took me a long time to decline it. I’ve listed the reasons below. It is possible we might reconsider this at some point, but for now marking it declined as I don’t think we can proceed with it in the language as things stand
Don Syme
F# Language Evolution

Original UserVoice Submission
Archived Uservoice Comments

@DoubleCouponDay
Copy link

@baronfel Can we get a written response on the declined reasoning? The "UserVoice" links have expired.

@abelbraaksma
Copy link
Member

The archived comments are somewhere here on github, though I keep forgetting how to get there, I run into the same issue often.

I think at some point the f# githubs were moved or renamed, but the archived comments were not, so these links were not automatically updated.

@abelbraaksma
Copy link
Member

The relevant bit, I think:

After consideration my belief is that this is too hard for F#, because of the reasons discussed in the PRs below: implementing disposal is best done explicitly. Also, when you consider things like the IAsyncDisposable pattern then I don't think it's necessarily the right thing to continue to hardwire F# as a language to the very imperative Dispose pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants