Friday, June 3, 2011

Studying F# : let in

I confused about "let in" clause because there are no explains and no descriptions about this in the book Professional F# 2.0. So I search about it in another sites, then I guess "let in" clause is used for "throwaway" binding. The sample is below:
> let useForRightSideOfIn arg =
-     System.Console.WriteLine(arg.ToString()) in List.iter useForRightSideOfIn [1;2;3];;
val it : unit = ()
> useForRightSideOfIn [1;2;3];;

  useForRightSideOfIn [1;2;3];;

stdin(3,1): error FS0039: The value or constructor 'useForRightSideOfIn' is not defined

No comments:

Post a Comment