From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 0B5F0BBAF for ; Mon, 15 Feb 2010 02:33:57 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0CAFczeEtV2gB5hWdsb2JhbACDBZgrAQEBCgsKBRUjrE+OO4EwglBbBIlh X-IronPort-AV: E=Sophos;i="4.49,473,1262559600"; d="scan'208";a="52738699" Received: from emailfrontal2.citycable.ch ([85.218.0.121]) by mail1-smtp-roc.national.inria.fr with SMTP; 15 Feb 2010 02:33:56 +0100 Received: from [192.168.0.12] (unknown [85.218.92.99]) (Authenticated sender: guillaume.yziquel@citycable.ch) by emailfrontal2.citycable.ch (Postfix) with ESMTPA id 7004FB10402; Mon, 15 Feb 2010 02:33:52 +0100 (CET) Message-ID: <4B78A4A1.5070106@citycable.ch> Date: Mon, 15 Feb 2010 02:34:25 +0100 From: Guillaume Yziquel Reply-To: guillaume.yziquel@citycable.ch User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707) MIME-Version: 1.0 To: Richard Jones Cc: OCaml List Subject: Re: [Caml-list] Wrapping var_args, or C ... in ocaml? References: <4B781ACC.4040603@citycable.ch> <20100214180650.GA22433@annexia.org> <4B787D32.10505@citycable.ch> <20100214225931.GC24949@annexia.org> <4B78838D.1040208@citycable.ch> <20100214231952.GD24949@annexia.org> In-Reply-To: <20100214231952.GD24949@annexia.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; guillaume:01 guillaume:01 ocaml:01 0100,:01 0100,:01 henrik:01 segfault:01 rewriting:01 ocaml:01 topfind:01 findlib:01 camlp:01 camlp:01 syntax:01 syntax:01 Richard Jones a =C3=A9crit : > On Mon, Feb 15, 2010 at 12:13:17AM +0100, Guillaume Yziquel wrote: >> Richard Jones a =C3=A9crit : >>> On Sun, Feb 14, 2010 at 11:46:10PM +0100, Guillaume Yziquel wrote: > > However I'm still confused what you are trying to do here. If you're > trying to bind the above, maybe look first at PyCaml? Well, somehow, PyCaml seems to never have wanted to work with me. I tried Art Yerkes' version, Thomas Fishbacher's version, Henrik=20 Stuart's version, and Yoann Padioleau's merge of these versions. Somehow=20 things always seem wrong. I get a segfault with Yoann Padioleau's=20 version due to the layout of the Python table function (WTF!? BTW). So I'm rewriting a Python embedding. http://yziquel.homelinux.org/gitweb/?p=3Docaml-python.git;a=3Dshortlog;h=3D= refs/heads/yziquel http://yziquel.homelinux.org/debian/pool/main/o/ocaml-python/ http://yziquel.homelinux.org/topos/api/ocaml-python/Python.html Sample session: > yziquel@seldon:~$ ocaml > Objective Caml version 3.11.1 >=20 > # #use "topfind";; > - : unit =3D () > Findlib has been successfully loaded. Additional directives: > #require "package";; to load a package > #list;; to list the available packages > #camlp4o;; to load camlp4 (standard syntax) > #camlp4r;; to load camlp4 (revised syntax) > #predicates "p,q,...";; to set these predicates > Topfind.reset();; to force that packages will be reloaded > #thread;; to enable threads >=20 > - : unit =3D () > # #require "python.interpreter";; > /usr/lib/ocaml/python: added to search path > /usr/lib/ocaml/python/python.cma: loaded > /usr/lib/ocaml/python/oCamlPython.cmo: loaded > # open Python;; > # let dolfin =3D Module.import "dolfin";; > val dolfin : Python.pymodule Python.t =3D > # let dictionary =3D Module.get_dict dolfin;; > val dictionary : Python.dict Python.t =3D > # let keys =3D Dict.keys dictionary;; > val keys : string list Python.t =3D > # let key_list =3D list_from keys;; > val key_list : string Python.t list =3D > [; ; ; ; ; ; ; ; > ; ; ; ; ; ; ; ; > ; ; ; ; ; ...] > # let string_list =3D List.map string_from key_list;; > val string_list : string list =3D > ["restriction"; "gt"; "precedence"; "TrialFunctions"; "ale"; "as_tens= or"; > "cross"; "__path__"; "shape"; "PETScFactory"; "has_mpi"; "down_cast"= ; > "differentiation"; "Mesh"; "has_scotch"; "rot"; "has_slepc"; "DOLFIN= _PI"; > "begin"; "le"; "outer"; "VectorElement"; "parameters"; "ln"; > "uBLASVector"; "uBLASDenseMatrix"; "tr"; "Assembler"; "terminal"; > "UnitCube"; "lt"; "CRITICAL"; "hermite"; "derivative"; "logger"; > "uBLASDenseFactory"; "norm"; "MPI"; "info"; "triangle"; "R1"; "R2"; --=20 Guillaume Yziquel http://yziquel.homelinux.org/