cloudRoutine / issueCommRepo

Sample Port of F# Uservoice Suggestions
0 stars 0 forks source link

allow use to not bind the expression to a name #67

Open cloudRoutine opened 7 years ago

cloudRoutine commented 7 years ago

allow use to not bind the expression to a name [12838449]

Submitted by Gauthier Segay on 3/7/2016 12:00:00 AM
[ 6 votes ]

In C#, one can use using(CreateSomeDisposable()) without binding the expression to a name. Same construct in F# is not allowed, forcing a workaround such as use __ = CreateSomeDisposable() allow to make it like this: use CreateSomeDisposable()

cloudRoutine commented 7 years ago

Posted by lr on 10/6/2016 1:22:00 PM

In my opinion the bigger annoyance is that a use expression can't even be bound to _ (single underscore), so if I want to use multiple uses, I need to write something like use _1 = CreateSomeDisposable() use 2 = CreateSomeDisposable() If I could instead bind it to the wildcard character , then I would be happy: use = CreateSomeDisposable() use = CreateSomeDisposable()