I've been using F# for three years and I don't think I ever noticed or ran into that case. :)

The code "f (x)" is "application" whereas "f(x)" (no space) is "high-precedence application", and apparently properties ("x.P") have a precedence in between these two. (At some point in the past, we considered making e.g.

1
printfn  "%A"  f(x)

legal, where high-precendence application would bind tight enough to be allowed as a curried argument, but that's another case where adding a space before the paren would change the semantics; today this is an error.)

There are lots of little nits about the language syntax that I don't love, but this one isn't even in my top ten. My advice for living a long and healthy life is to accept it with a smile and move on :)

By on 1/6/2011 5:41 PM ()

The code "f (x)" is "application" whereas "f(x)" (no space) is "high-precedence application".

Actually that seems fairly sensible when you put it that way. Thanks.

Could be a bit dangerous in the off-case when the argument is of the same type as the member, though.

By on 1/6/2011 6:01 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