Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is It Possible To Combine Multiple Attributes In F#?

Tags:

attributes

f#

I'm trying to figure out the F# equivalent of this C# Attribute delclaration:

[
   ComImport(),
   InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
   Guid("000214EE-0000-0000-C000-000000000046")
]

I can do this and it compiles fine:

[<ComImport>]
[<InterfaceType(ComInterfaceType.InterfaceIsIUnknown)>]
[<Guid("000214EE-0000-0000-C000-000000000046")>]

But I am curious now--is it possible to combine multiple attributes in F#? When I try something like this for the first two attributes:

[<ComImport>,<InterfaceType(ComInterfaceType.InterfaceIsIUnknown)>]

I get an FS0010 error. Also tried this:

[<ComImport , InterfaceType(ComInterfaceType.InterfaceIsIUnknown)>]

Same result.

Is this possible and if so what's the correct syntax?

like image 947
Onorio Catenacci Avatar asked Mar 08 '12 16:03

Onorio Catenacci


1 Answers

Yes.

[<
  ComImport; 
  InterfaceType(ComInterfaceType.InterfaceIsIUnknown); 
  Guid("000214EE-0000-0000-C000-000000000046")
>]
like image 107
Daniel Avatar answered Oct 20 '22 17:10

Daniel