You can't use a function as an attribute property, only primitive types (int, string, etc.) and System.Type. It's a .NET restriction.

By on 3/18/2008 4:18 PM ()

Thanks for the response.

I worked around it by using a type which I expect to have some certain constructor types and a certain method on it. Not ideal for what I want to do but it basically works.

As some background, this is essentially an extension to the schema compiler type approach from the Expert F# book. A record describes a data format extracted from an external source, with attributes describing where to get the data from. But in some cases I want to supply a data converter function that converts the data from the external source into the data I want to store in the record. So I would like to be able to supply this function in the attribute.

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