.net - Instantiating types: when using new? -


i have type mapping class in f# follows:

type myclass =    val myval: integer    new () = {       myval = 0;    }    member self.myval       () = self.myval 

well, want create instance of class. can so:

let myinstance = myclass () 

or

let myinstance = new myclass () 

what's difference? can both?

for types implements idisposable should instantiated using new. otherwise following compilation warning.

it recommended objects support idisposable interface created using 'new type(args)' rather 'type(args)' indicate resources may owned generated value


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -