Created
September 30, 2010 14:14
-
-
Save scitesy/604634 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Here's the view of an f# interactive session. | |
> open System.IO;; | |
> let foo = new MemoryStream();; | |
val foo : MemoryStream | |
> let bar = foo;; | |
val bar : MemoryStream | |
> let fooy() = MemoryStream();; | |
let fooy() = MemoryStream();; | |
-------------^^^^^^^^^^^^^^ | |
stdin(4,14): warning FS0760: It is recommended that objects that support the IDisposable interface are created using 'new Type(args)' rather than 'Type(args)' to indicate that resources may be owned by the generated value | |
val fooy : unit -> MemoryStream | |
> let bary = fooy();; | |
val bary : MemoryStream | |
//let foo() = MemoryStream() return can be read as "a function that takes a unit(void), which returns a //function that returns a MemoryStream". So it is different than let foo = MemoryStream(). I'm not sure why //a unit(void) would ever be passed in but hey it is different. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment