strange. I get a different result:

1
2
3
4
5
6
7
> 1:int;;

  1:int;;
  -^^

stdin(2,1): error FS0191: syntax error.
> val it : (int -> int) = <fun:it@2>

using brackets helps so:

1
2
> (1:int);;
val it : int = 1

regards,

Danny

By on 8/27/2008 3:44 AM ()

In this case FSI is recovering from a syntax error and continuing to process input. This behaviour will be corrected to stop-on-first-error in the F# September CTP release, which will be out soon.

In the first example, the "1:" causes a syntax error, since type-annotated expressions need parentheses at the top level. The remainder of the expression is "int", which is a library-defined function for converting things to integers.

Don

By on 8/28/2008 5:05 PM ()
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