Hi Mau,

this error is caused by the syntax of anonymous function declaration. The semicolon after fun is interpreted as a sequencing operation and in this context

1
Center = (0.25, 0.25)

would become a boolean expression (using structural equality) that was part of the lambda.

You can fix this by inserting parentheses at the correct location so:

1
2
let nwCorner =
    { Name = "NW"; Membership = (fun (x, y) -> x + y <= 0.5); Center = (0.25, 0.25); }

or use #light syntax so:

1
2
3
4
let nwCorner =
    {   Name = "NW"; 
        Membership = fun (x, y) -> x + y <= 0.5;
        Center = (0.25, 0.25); }

regards,

Danny

By on 12/22/2008 4:20 AM ()

Oh, I see!
Thanks a lot Danny!

Mau

By on 12/22/2008 4:36 PM ()

Ehm, sorry for the typo in the subject.
Mau

By on 12/22/2008 2:58 AM ()
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