Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Automatic wrapper generator
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: SWAMPY <swampy@s...>
Subject: [Caml-list] Functional critical section
Hello!

   I'm very new to ocaml, and I'm trying to figure out how
to do something that may or may not actually be possible.
Any suggestions?

    I'd like to write

        <name> <expr>

    as an expression, and have this evaluate <expr> first
evaluating fixed expression A, and then after evaluting
<expr> evaluate fixed expression B.
    Then, I could do something like:

    critical (threadsafeFunction arg1 arg2 arg3)

    and have this do the equivalent of

    Mutex.lock someMutex; let tmp = threadsafeFunction arg1
arg2 arg3; Mutex.unlock someMutex; tmp;;

    Is this sort of thing possible?  In general I'm
interested in techniques I could use to wrap
imperative-biased parts of the library to more functional
constructs.

    Cheers,

    David J. Trombley

-------------------
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