From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA32758; Tue, 12 Nov 2002 13:45:01 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA32752 for ; Tue, 12 Nov 2002 13:45:00 +0100 (MET) Received: from c007.snv.cp.net (h008.c007.snv.cp.net [209.228.33.236]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id gACCixX11251 for ; Tue, 12 Nov 2002 13:44:59 +0100 (MET) Received: (cpmta 10440 invoked from network); 12 Nov 2002 04:44:57 -0800 Received: from 65.187.194.217 (HELO localhost) by smtp.directvinternet.com (209.228.33.236) with SMTP; 12 Nov 2002 04:44:57 -0800 X-Sent: 12 Nov 2002 12:44:57 GMT Date: Tue, 12 Nov 2002 07:44:52 -0500 Subject: Re: [Caml-list] custom toplevel under darwin Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v482) Cc: caml-list@inria.fr To: Lex Stein From: jehenrik In-Reply-To: Message-Id: <8A0C060C-F63C-11D6-901A-00039375801A@yahoo.com> Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.482) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Ah, got it. Has nothing to do with portability. The external definitions must be in a file named .ml, not .mli in order to get linked in. Thanks for helping me with my debugging myopia. Jeff Henrikson On Tuesday, November 12, 2002, at 04:17 AM, Lex Stein wrote: > > Try: > > ocamlmktop -custom inspect.o intro_runtime.ml -o top > > This works for me Ocaml 3.06 / OS X 10.2 with the inspect.c example from > the O'Reilly book. > > Does it work for you ? If not, what are the error messages ? > > Lex > > On Tue, 12 Nov 2002, jehenrik wrote: > >> Are custom toplevels supposed to work under darwin with ocaml 3.06? I >> have a simple .cpp file from the OReily book: >> >> >> inspect.c: >> >> #include >> #include >> >> extern "C" value inspect (value v) >> { >> if (Is_long(v)) >> printf ("integer (%ld) : %ld", (long) v, Long_val(v)); >> else if (Is_block(v)) >> printf ("v is a pointer"); >> else >> printf ("v is neither an integer nor a pointer (???)"); >> printf(" "); >> fflush(stdout) ; >> return v ; >> } >> >> >> >> >> and a simple .ml file, intro_runtime.ml: >> >> external inspect1 : 'a -> 'a = "inspect" ;; >> inspect1 123;; >> >> >> >> As a standalone program this works fine: >> >> ocamlc -custom inspect.o intro_runtime.ml -o intro_runtime # this works >> >> >> But this way of making a toplevel, along with all the variations I can >> think of, doesn't: >> >> ocamlmktop -custom inspect.o -o intro_runtime >> >> >> # external inspect1 : 'a -> 'a = "inspect" ;; >> external inspect1 : 'a -> 'a = "inspect" >> # inspect1;; >> The external function `inspect' is not available >> # inspect1 123;; >> The external function `inspect' is not available >> >> >> >> If this functionality is not ported, I would appreciate it if somebody >> could pass that on to me. >> >> >> Jeff Henrikson >> >> ------------------- >> 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 >> > ------------------- 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