A blog about SQL Server, SSIS, C# and whatever else I happen to be dealing with in my professional life.

Find ramblings

Friday, September 11, 2009

F# declaration loop-de-loop

Just a quick note as it's late and I should have been in bed a few hours ago, but

let ceiling = 1000 -1

fails with "This value is not a function and cannot be applied" Why? The whitespace. As it parses now, F# is attempting to call the 1000 function with a parameter of -1*. If either the space between the 0 and - is removed or if an extra space is inserted between the - and the 1, then it will work. F# doesn't know what to do with negative one, but does know how to add negative one to 1000. Any of the following three would work

let ceiling1 = 1000-1
let ceiling2 = 1000 - 1
let ceiling3 = 1000 + -1
*At least, that's my guess. Seems reasonable enough at this point

No comments: