Hi,

In Caml syntax (and F# without light), there are two different things:
- The "let ... in ..." construct is an expression.
- The "let ..." construct is a declaration. The "member" construct is also a declaration.

In a class declaration, you need a set of declarations. You cannot use an expression here. Think about it: everywhere you can use a "let ... in ..." construct, you can use a simple value.

Moreover, the syntax is "let ... in <expression>". Member is not an expression, you can't replace member with an integer, for example.

I hope it's more clear for you, now. By the way, I recommend you to use the #light syntax when you can (exceptions include generated code, for example in a fsyacc file).

Laurent.

By on 11/9/2007 2:51 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