F# and GIMP#
December 2, 2007 at 10:04 pm | In GIMP, Programming | 4 CommentsI almost got my first F# plug-in running on GIMP#. It took me some time to get used to the syntax even with a background in functional languages like Lisp and Scheme. Only thing left to figure out is how I can override a C# function that returns an IEnumerable. What I’ve got sofar is:
override x.ListProcedures() : seq<Procedure> =
let procedure = new Procedure()
procedure.MenuPath <- “<Image>/Filters/Generic”
// And now what?
The C# signature of this routine is
protected abstract IEnumerable<Procedure> ListProcedures() ;
Hope to find an answer pretty soon.
Update 3 December 2007: seems that returning an IEnumerable is quite easy (many thanks to Robert Pickering):
[procedure] :> seq<Procedure>
4 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.
I love these comparisons, keep ‘em coming. Hopefully you can figure out the last thing so that we can see how fast F# is
Comment by Anders Rune Jensen — December 3, 2007 #
I’m glad you like my comparisons. Apart from F# I think only Ruby (IronRuby or Ruby.NET) is another candidate for a plug-in. Unless there are other .NET languages I have overlooked so far.
Comment by maurits — December 3, 2007 #
Cool, F#…
If I’m not mistaken, F# is somewhat similar to OCaml?
Here at work I used to have a lot of fun with that… But exactly the issues you are looking at now seem to be F# specific, so I don’t think I can help you.
Cheers, Arnaud
Comment by Arnaud Gouder — December 3, 2007 #
Hey Arnaud
Yep, I think F# was heavily influenced by OCaml. From what I’ve seen so far it’s a pretty cool language. One of the F# guru’s (Robert Pickering) already suggested a solution for the problem I mentioned in my blog. I will try this evening.
Comment by maurits — December 3, 2007 #