From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: Richard Jones <rich@annexia.org>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Wrapping var_args, or C ... in ocaml?
Date: Mon, 15 Feb 2010 02:34:25 +0100 [thread overview]
Message-ID: <4B78A4A1.5070106@citycable.ch> (raw)
In-Reply-To: <20100214231952.GD24949@annexia.org>
Richard Jones a écrit :
> On Mon, Feb 15, 2010 at 12:13:17AM +0100, Guillaume Yziquel wrote:
>> Richard Jones a écrit :
>>> 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
Stuart's version, and Yoann Padioleau's merge of these versions. Somehow
things always seem wrong. I get a segfault with Yoann Padioleau's
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=ocaml-python.git;a=shortlog;h=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
>
> # #use "topfind";;
> - : unit = ()
> 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
>
> - : unit = ()
> # #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 = Module.import "dolfin";;
> val dolfin : Python.pymodule Python.t = <abstr>
> # let dictionary = Module.get_dict dolfin;;
> val dictionary : Python.dict Python.t = <abstr>
> # let keys = Dict.keys dictionary;;
> val keys : string list Python.t = <abstr>
> # let key_list = list_from keys;;
> val key_list : string Python.t list =
> [<abstr>; <abstr>; <abstr>; <abstr>; <abstr>; <abstr>; <abstr>; <abstr>;
> <abstr>; <abstr>; <abstr>; <abstr>; <abstr>; <abstr>; <abstr>; <abstr>;
> <abstr>; <abstr>; <abstr>; <abstr>; <abstr>; ...]
> # let string_list = List.map string_from key_list;;
> val string_list : string list =
> ["restriction"; "gt"; "precedence"; "TrialFunctions"; "ale"; "as_tensor";
> "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";
--
Guillaume Yziquel
http://yziquel.homelinux.org/
next prev parent reply other threads:[~2010-02-15 1:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-14 15:46 Guillaume Yziquel
2010-02-14 18:06 ` [Caml-list] " Richard Jones
2010-02-14 20:26 ` Richard Jones
2010-02-14 22:46 ` Guillaume Yziquel
2010-02-14 22:59 ` Richard Jones
2010-02-14 23:13 ` Guillaume Yziquel
2010-02-14 23:19 ` Richard Jones
2010-02-15 1:34 ` Guillaume Yziquel [this message]
2010-02-15 2:37 ` Thomas Fischbacher
2010-02-14 23:31 ` Richard Jones
2010-02-15 10:16 ` Florent Monnier
[not found] ` <201002151106.23642.fmonnier@linux-nantes.fr.eu.org>
[not found] ` <4B7F3FED.4010100@citycable.ch>
2010-02-20 2:41 ` Guillaume Yziquel
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=4B78A4A1.5070106@citycable.ch \
--to=guillaume.yziquel@citycable.ch \
--cc=caml-list@inria.fr \
--cc=rich@annexia.org \
/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