It is very similar to C# syntax with the edition of "< >".

[<DllImport("user32.dll", CharSet = CharSet.Auto)>]

Have you tried that?

By on 3/7/2008 9:24 AM ()

The request is to attach the attribute to the constructor. This is not currently possible using the implicit class syntax, instead you have to resort to the explciit class syntax.

1
2
3
4
5
6
7
8
9
10
 

type C = class

    [<Attrib(...)>]

    new() = 

end

One current design goal for the F# team is to make the explicit class syntax redundant, i.e.to ensure that you can always do everything with the implicit class syntax alone. This is one thing to address there. We'll no doubt do it by an attribute target:

1
2
3
4
5
6
7
8
9
10
 

[<method: Attrib(...)>]

type C() = class

    ...

end

Kind regards

don

By on 3/7/2008 2:33 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