F# using with indent syntax
there is
using (new SqlConnection(insql)) ( Open(); )
or
using (new SqlConnection(insql)) <| fun c ->
c.Open()
I want indent but without c alike
using (new SqlConnection(insql)) ->
Open()
How can I do i开发者_Python百科t ?
There's no way to do that; since Open
is an instance method it needs to be preceded by the object which it's being called on.
I'd typically avoid using
entirely and use a use
-binding:
use c = new SqlConnection(insql)
c.Open()
精彩评论