Hi Mark,

As far as I know no one has tried using camlp4 with F#. For the common compatible core language between OCaml and F# I wouldn't be surprised if the version of camlp4 from the OCaml distribution just works directly. However it won't work for features of F# that are lie outside this core language, nor if the generated code uses Caml-specific techniques.

Quoted languages are a major interest of mine (e.g. see the F#/LINQ paper on my website). However it's not likely we're going to add arbitrary Camlp4-like static pre-processing to F# for a while. Did you have a particular use is mind?

Cheers!

Don

By on 9/8/2006 10:32 PM ()

I've no idea how you'd integrate camlp4 into Visual Studio, but using camlp4 with F# should be easy enough. You'd need to alter the grammar to understand F# grammar (there are relatively few differences and none that are prohibitively difficult, AFAIK).

I only started using camlp4 relatively recently and it can be very useful. I have used it for four main things: writing stream based parsers, extending pattern matching syntax to allow "Add(a, Mul(b, c))" to be written "a+b*c", extending pattern matching to handle sequences represented by balanced binary trees, and using OCaml's built-in lazy streams. So I do think it would be a nice-to-have.

Check out some of my OCaml examples that use camlp4:

[link:www.ffconsultancy.com]

[link:www.ffconsultancy.com]

Cheers,

Jon.

By on 10/5/2006 4:27 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