Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11?

2009-10-05 Thread Conglun Yao
On Mon, Oct 5, 2009 at 8:39 AM, David Allsopp dra-n...@metastack.comwrote: Hmm - a few other things to check: 1. Are you definitely using Cygwin's PCRE and which version (run pcre-config --prefix and pcre-config --version) 2. Which version of ocaml-pcre is findlib trying to load (#use

Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11?

2009-10-05 Thread Conglun Yao
Thanks for all of your help. Unfortunately, it still does not work. It is really nightmare to use camp4 in a windows machine. I try to reinstall plain OCaml without using GODI, if the same error happens, I have to go back to Ubuntu. Thanks. Conglun On Mon, Oct 5, 2009 at 2:35 PM, Gerd

[Caml-list] Dynlink and ocamlfind for camlp4 3.11?

2009-10-04 Thread Conglun Yao
Dear all, I have tried to use json-static in OCaml 3.11, but met the annoying problem: Reference to undefined global `Dynlink' As Camlp4 3.11 requires explicit load of dynlink, so I tried ocamlfind ocamlc -package dynlink, json-static -syntax camlp4o -o

[Caml-list] Re: Dynlink and ocamlfind for camlp4 3.11?

2009-10-04 Thread Conglun Yao
On Sun, Oct 4, 2009 at 3:22 PM, Conglun Yao yaocong...@gmail.com wrote: Dear all, I have tried to use json-static in OCaml 3.11, but met the annoying problem: Reference to undefined global `Dynlink' As Camlp4 3.11 requires explicit load of dynlink, so I tried

Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11?

2009-10-04 Thread Conglun Yao
+ findlib 1.2.5 + json-staic 0,9.8 Everything works fine when I use Ubuntu, but when changed to cygwin, it breaks. Conglun On Sun, Oct 4, 2009 at 8:05 PM, Richard Jones r...@annexia.org wrote: On Sun, Oct 04, 2009 at 03:22:31PM +0100, Conglun Yao wrote: Dear all, I have tried to use json

Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11?

2009-10-04 Thread Conglun Yao
In that case, try listing dynlink explicitly, like: ocamlfind ocamlc dynlink.cma -package json-static [etc] $ ocamlfind ocamlc dynlink.cma -package json-static -syntax camlp4o -c test.ml $ ocamlfind ocamlc -I /home/conglun/godi/lib/ocaml/pkg-lib/camlp4 dynlink.cma -package json-static

Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11?

2009-10-04 Thread Conglun Yao
On Sun, Oct 4, 2009 at 8:53 PM, Conglun Yao yaocong...@gmail.com wrote: In that case, try listing dynlink explicitly, like: ocamlfind ocamlc dynlink.cma -package json-static [etc] $ ocamlfind ocamlc dynlink.cma -package json-static -syntax camlp4o -c test.ml $ ocamlfind ocamlc -I

Re: [Caml-list] Dynlink and ocamlfind for camlp4 3.11?

2009-10-04 Thread Conglun Yao
Thanks for all of your help. I tried, and it works fine until the require of json-static. It breaks when loading pcre.cma. Now we can say that pcre package has some problem, but dynlink is loaded successfully. Test1 $ ocaml Objective Caml version 3.11.1 # #load dynlink.cma;; # let x

Re: [Caml-list] Inflection lib for ocaml ?

2009-06-19 Thread Conglun Yao
On Fri, Jun 19, 2009 at 10:52 AM, Richard Jones r...@annexia.org wrote: On Fri, Jun 19, 2009 at 03:02:36AM +0100, Conglun Yao wrote: I'm wondering is there any library in OCaml performing word inflection between singular and plural, like Lingua-EN-Inflect in perl. Or someone is already doing

Re: [Caml-list] How to achieve this camlp4 syntax extension

2009-04-02 Thread Conglun Yao
]. Cheers,  David On Thu, 2009-04-02 at 12:42 +0100, Conglun Yao wrote: Dear all, I tried to achieve the following syntax extension, but failed. Add expression .[ ] after a module name, inside .[ ] I want to refer to the specified module, like let _ = M1.M2.[ here is my syntax,  using M1.M2

Re: [Caml-list] How to compile project with sub directories (using OcamlMakefile)

2009-03-11 Thread Conglun Yao
by changing the SRC variables. Note that I made a small patch to OCamlMakefile to do this. Peng On Saturday 07 March 2009 07:36:45 pm Conglun Yao wrote: Dear camlers, I've been stuck by this problem for few days, and can't find the answer.  I built a project with several sub directories, like lib01

[Caml-list] How to compile project with sub directories (using OcamlMakefile)

2009-03-07 Thread Conglun Yao
Dear camlers, I've been stuck by this problem for few days, and can't find the answer. I built a project with several sub directories, like lib01, lib02 and lib03, and create a Makefile in each directory. In the top level, I have a Makefile like : all: @cd lib01 make all @cd

[Caml-list] How to handle try .... finally properly?

2008-12-10 Thread Conglun Yao
Sorry, no replies in ocaml-beginner, post it again in caml-list. Dear all, I'm thinking about how to handle try finally in ocaml, and found one of camlp4 implementations from http://bluestorm.info/camlp4/dev/try/pa_tryfinally.ml.html Example code adopted from Gabriel Scherer's

[Caml-list] Camlp4 generate more than one (compiled) files?

2008-10-17 Thread Conglun Yao
Dear all, I'm just wondering is it possible to use camlp4 to generate more than one compiled files. Normally, camlp4 preprocesses a file and then pass it directly to compiler (for *.cmo), or its pretty-printer (for *.ml or other 'plain' file). In my case, I want to extend the syntax, and write

Re: [Caml-list] Camlp4 generate more than one (compiled) files?

2008-10-17 Thread Conglun Yao
Rich, Thanks for your reply. What you mentioned in your blog: In fact saving the AST into the cmo file is relatively simple: we just turn it into a string (using Marshal) and write out the string as a camlp4 substitution: let bitmatch ext2sb = { ... } becomes: let ext2sb = string containing

Re: [Caml-list] conjunctive type in polymorphic variants

2008-10-09 Thread Conglun Yao
Nicolas and Olivier, Thanks for your quick reply, it makes sense! Conglun On Thu, Oct 9, 2008 at 9:43 AM, Olivier Andrieu [EMAIL PROTECTED] wrote: Hi, On Thu, Oct 9, 2008 at 06:15, Conglun Yao [EMAIL PROTECTED] wrote: Sorry, I can't fully understand the source code, but it seems we can

[Caml-list] conjunctive type in polymorphic variants

2008-10-08 Thread Conglun Yao
Hi all, I have just met a strange problem (it might have already been answered, but I can't find the it) while using camlp4 to generate a polymorphic type like: type t = [ `A of int * int | `B of string ] error msg The present constructor A has a conjunctive type is thrown by the compiler. I