From: Kip Macy <kmacy@fsmware.com>
To: caml-list@inria.fr
Subject: [Caml-list] problem with Printf.printf when linking in bytecode interpreter to C app
Date: Sun, 25 Jan 2004 19:42:01 -0800 (PST) [thread overview]
Message-ID: <20040125193722.J53910@demos.bsdclusters.com> (raw)
I've linked the ocaml runtime into my application:
this is my ocaml.ml:
let _ = Printf.printf "ocaml inited\n"
let foo () = Printf.printf "this works\n"
let rec fib n = if n < 2 then 1 else fib(n-1) + fib(n-2)
let _ = Callback.register "foo" foo
let _ = Callback.register "fib" fib
This is the relevant C code:
printf("calling caml_startup\n");
caml_startup(argv);
callback(*caml_named_value("foo"), Val_unit);
result = Int_val(callback(*caml_named_value("fib"), Val_int(6)));
printf("the result of fib is %d\n", result);
The only output I get is:
calling caml_startup
the result of fib is 13
Why don't the Printf.printf statements output anything?
Thanks.
-Kip
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next reply other threads:[~2004-01-26 3:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-26 3:42 Kip Macy [this message]
2004-01-26 4:56 ` SooHyoung Oh
2004-01-26 5:52 ` Kip Macy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040125193722.J53910@demos.bsdclusters.com \
--to=kmacy@fsmware.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox