ToShortDateString is an instance method of the DateTime class, which takes no parameters; as such, it should be applied with Unit...

1
2
let dtmToday = System.DateTime.Today.ToShortDateString ();;

Your code effectively creates a partial application via a closure. In other words, you could also write the following...

1
2
3
4
let dtmToday = System.DateTime.Today.ToShortDateString;;

printfn "%A" (dtmToday ())

This is exactly what FSI is telling you in the final line

1
2
val it : (unit -> string) = <fun:dtmToday@3>

If one is learning an ML-based language, its probably best for one to understand ML's rather specific type notation.

Also, off topic, what does CommunityServer discriminate against Mac users?

By on 1/2/2010 4:40 PM ()

Hello, Paulmichael Blasucc:
Thank you very much for your code and explanation, now I understand it much better.
Thanks again!

By on 1/3/2010 1:03 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper