Re: [Caml-list] Toplevel debugging.

2010-01-25 Thread Jérémie Dimino
Le samedi 23 janvier 2010 à 18:29 +0100, Guillaume Yziquel a écrit : > >> # Fatal error: exception Sys_blocked_io > >> yziq...@seldon:~/git/mlgame$ It is because mlgame set stdin into non-blocking mode (file input.ml, line 81) and the toplevel does not support that. If you want to be able to put

Re: [Caml-list] Toplevel debugging.

2010-01-23 Thread Jake Donham
On Sat, Jan 23, 2010 at 9:29 AM, Guillaume Yziquel wrote: > I am wondering how to use a debugger with libraries in the toplevel. As > /usr/bin/ocaml is bytecode and that the exception is raised from OCaml and > not from C code, I do not have a backtrace: You may find this patch helpful; it adds b

[Caml-list] Toplevel debugging.

2010-01-23 Thread Guillaume Yziquel
Hello. I've been trying to reuse the mlgame codebase, and I've encountered a weird issue. When linked into native code or into bytecode, the library works fine, and the system exits with a 0 errorlevel. However, when trying to #require the package from the toploop, I get the following error.

[Caml-list] Toplevel function question

2009-05-13 Thread Joel Christner
Hello, I hope you guys don't mind another beginner's question, I'm waiting on approval from the Yahoo! group moderator for the beginner's section. I'm trying to implement a toplevel function that will accept input from stdin (someone running the program will do ./programname < someinputfile), sto

Re: [Caml-list] Toplevel with camlp4

2009-03-26 Thread Andre Nathan
On Thu, 2009-03-26 at 22:15 -0400, Peng Zang wrote: > Are you using OCaml 3.10? I recall there's a bug that doesn't let you #use > more than once due to bad file descriptors. It's been fixed in 3.11 That was it. Thanks! Andre ___ Caml-list mailing l

Re: [Caml-list] Toplevel with camlp4

2009-03-26 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Are you using OCaml 3.10? I recall there's a bug that doesn't let you #use more than once due to bad file descriptors. It's been fixed in 3.11 Peng On Thursday 26 March 2009 09:59:20 pm Andre Nathan wrote: > Hello > > I have the simple program bel

[Caml-list] Toplevel with camlp4

2009-03-26 Thread Andre Nathan
Hello I have the simple program below: let () = Sys.interactive := false; Toploop.initialize_toplevel_env (); for i = 1 to (Array.length Sys.argv) - 1 do ignore (Toploop.use_file Format.std_formatter Sys.argv.(0)) done which works fine when compiled with $ ocamlc -o a

Re: [Caml-list] Toplevel - load cmo from given location

2009-01-09 Thread Richard Jones
On Fri, Jan 09, 2009 at 03:08:18PM +, Dawid Toton wrote: > > >>The problem is that it gives "Unbound module Enum" while no error about > >>loading the cmo&cmi is shown. > > > >The #directory instruction is needed to find the .cmi. > > I see, so there are 2 problems: > * why the failure to lo

Re: [Caml-list] Toplevel - loading dependencies

2009-01-09 Thread Dawid Toton
in case you're doing so this way: ocamlc -o my.cma mod1.ml mod2.ml mod3.ml mod4.ml this will recompile everything, but you can use in your makefile: (...) then you don't recompile everything, only the modified module Yes, with ocamlbuild I need not to recompile everything, but it's slow trave

Re: [Caml-list] Toplevel - loading dependencies

2009-01-09 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Shouldn't ocamldep be able to solve this? It can read a source file and figure out the dependencies. So you could in theory generate a fake source file that is just "open A" and it should figure out the set of dependencies for module A. Peng On

Re: [Caml-list] Toplevel - loading dependencies

2009-01-09 Thread Florent Monnier
> If I put everything into one big cma, then I have to recompile it every > small change. It takes so long time, that it would make no sense to use > the interpreter at all. in case you're doing so this way: ocamlc -o my.cma mod1.ml mod2.ml mod3.ml mod4.ml this will recompile everything, but you

Re: [Caml-list] Toplevel - load cmo from given location

2009-01-09 Thread Dawid Toton
The problem is that it gives "Unbound module Enum" while no error about loading the cmo&cmi is shown. The #directory instruction is needed to find the .cmi. I see, so there are 2 problems: * why the failure to load cmi is silent in this case? * why the toplevel fails to check for cmi where

Re: [Caml-list] Toplevel - load cmo from given location

2009-01-09 Thread Christophe TROESTLER
On Fri, 09 Jan 2009 14:06:25 +, Dawid Toton wrote: > > I've noticed stange behaviour: > > The following works OK (using #directory directive): > > #!/usr/bin/ocamlrun ocaml > #directory "/home/dt2/Calc1/CalcEngine/src/_build/extlib/" > #load "enum.cmo" > open Enum > > But this version not (

Re: [Caml-list] Toplevel - loading dependencies

2009-01-09 Thread Matthieu Dubuget
Dawid Toton a écrit : > What is the right solution? What about camlfind? Salutations Matt ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: ht

[Caml-list] Toplevel - loading dependencies

2009-01-09 Thread Dawid Toton
Another problem with loading modules in the toplevel: I need to use the module A. So I write: #load "A.cmo" to get a messsage "Reference to undefined global B" So I prepend a line: #load B.cmo and get another "undefined global". Then it repeats prohibitively many times. This is resolving depende

[Caml-list] Toplevel - load cmo from given location

2009-01-09 Thread Dawid Toton
I've noticed stange behaviour: The following works OK (using #directory directive): #!/usr/bin/ocamlrun ocaml #directory "/home/dt2/Calc1/CalcEngine/src/_build/extlib/" #load "enum.cmo" open Enum But this version not (using the full path directly): #!/usr/bin/ocamlrun ocaml #load "/home/dt2/Ca

Re: [Caml-list] toplevel not executed: Bug ?

2008-09-03 Thread Stéphane Glondu
Romain Beauxis wrote: > I've encountered a strange bug while preparing a caml module with C function. > Depending on the execution of a caml-defined function, the toplevel is > evaluated or not, leading to a segfault when calling a caml callback from C. > [...] I don't know whether this is a bug

[Caml-list] toplevel not executed: Bug ?

2008-09-03 Thread Romain Beauxis
Hi all ! I've encountered a strange bug while preparing a caml module with C function. Depending on the execution of a caml-defined function, the toplevel is evaluated or not, leading to a segfault when calling a caml callback from C. The code of the C part is: <--- #include #include

Re: [Caml-list] toplevel

2008-07-04 Thread Alain Frisch
Jean Krivine wrote: Hello I am trying to make a toplevel including differnent cmo (OBJS=./dir1/obj1.cmo ./dir2/obj2.cmo ...) contained in different directories (OCAMLINCLUDES= -I ./dir1 -I ./dir2 ...). If I type make toplevel (see excerpt of my makefile below) I obtain a toplevel that does what

[Caml-list] toplevel

2008-07-04 Thread Jean Krivine
Hello I am trying to make a toplevel including differnent cmo (OBJS=./dir1/obj1.cmo ./dir2/obj2.cmo ...) contained in different directories (OCAMLINCLUDES= -I ./dir1 -I ./dir2 ...). If I type make toplevel (see excerpt of my makefile below) I obtain a toplevel that does what I want (I can load all