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 Stolpman

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 wrote: > > 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 "topfind";; > #list;

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";; # l

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 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

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-stati

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

2009-10-04 Thread Conglun Yao
em: cygwin + OCaml 3.11.1 + 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 wrote: > On Sun, Oct 04, 2009 at 03:22:31PM +0100, Conglun Yao wrote: > > Dear all, > >

[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 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 expli

[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

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

2009-06-19 Thread Conglun Yao
r) Thanks. Conglun On Fri, Jun 19, 2009 at 10:52 AM, Richard Jones 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 per

[Caml-list] Inflection lib for ocaml ?

2009-06-18 Thread Conglun Yao
Dear all, 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 the work? I can only find code snapshot in Pleac_ocaml (Printing Correct Plurals) http://pleac.sourceforge.net/pleac_ocaml/nu

[Caml-list] Data type representing 'Money'

2009-05-16 Thread Conglun Yao
Hi all, Is there any data type could be used to represent 'Money' in OCaml, similar to BigDecimal. I see a lot of programs using float directly. Maybe Num would be better, but less document could be found, for example, how to represent 20.27 Or there already exist a better solution. Thanks for a

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

2009-04-02 Thread Conglun Yao
Nice code!!! Thank you very much. I'm trying to get the Module name, then used in my syntax extension. ModuleName.[ my extension ] It's really a great idea to perform checking in the rule definition. Conglun On Thu, Apr 2, 2009 at 2:00 PM, Zheng Li wrote: > On 4/2/2009 1:42 PM

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

2009-04-02 Thread Conglun Yao
] using module [M1.M2]. > > 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 ref

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

2009-04-02 Thread Conglun Yao
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 module ] Here is my attempt (failed) EXTEND Gram GLOBAL: expr; expr: LEV

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

2009-03-11 Thread Conglun Yao
hanging 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

[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

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

2008-12-10 Thread Conglun Yao
> A usual workaround in such situations is to first partially apply your > function to the (n-1) first arguments, as this should cause no > side-effects. Since I suppose you are really talking about > > transform f x y > > you should rather write > > transform (f x) y > It indeed helps, forces t

[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 pa_tryfinall

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 = "" If I understand c

[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 a

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

[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