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 WAA21907; Tue, 18 May 2004 22:13:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA21971 for ; Tue, 18 May 2004 22:13:49 +0200 (MET DST) Received: from caged.spacebird.net (caged.spacebird.net [66.92.161.180]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i4IKDmEV029753 for ; Tue, 18 May 2004 22:13:48 +0200 Received: from [10.92.1.1] (helo=word) by caged.spacebird.net with smtp (Exim 3.36 #1 (Debian)) id 1BQBfj-0003EH-00 for ; Tue, 18 May 2004 16:58:47 -0400 Message-ID: <006801c43d14$61edef40$10015c0a@word> From: "SWAMPY" To: "caml-list" References: <1084869517.19838.409.camel@pelican.wigram> <20040518090635.GA6918@bourg.inria.fr> <1084875941.19838.446.camel@pelican.wigram> <20040518121147.GA20094@redhat.com> <1084910535.30471.49.camel@ice.gerd-stolpmann.de> Subject: [Caml-list] Functional critical section Date: Tue, 18 May 2004 16:10:44 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Miltered: at nez-perce with ID 40AA6E7C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; expr:01 expr:01 ocaml:01 constructs:02 library:03 let:04 equivalent:05 functional:06 functional:06 cheers:06 arg:06 arg:06 mutex:06 mutex:06 wrap:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 as an expression, and have this evaluate first evaluating fixed expression A, and then after evaluting 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