Created
August 27, 2012 12:18
-
-
Save jsakamoto/3487956 to your computer and use it in GitHub Desktop.
これはコンパイルが通る(.NETのFileInfoクラスはnullになりうる)
This file contains 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
open System.IO | |
open System.Linq | |
let dir = new DirectoryInfo("c:\\") | |
let fileOfFoo = dir.GetFiles().FirstOrDefault(fun f -> f.Name = "foo") | |
printfn "%s" (if fileOfFoo = null then "null!" else "exists!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment