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 OAA06313; Thu, 12 Apr 2001 14:39:53 +0200 (MET DST) 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 OAA06295 for ; Thu, 12 Apr 2001 14:39:52 +0200 (MET DST) Received: from tor.abc.se (ns.abc.se [195.17.72.11]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3CCdob02660 for ; Thu, 12 Apr 2001 14:39:50 +0200 (MET DST) Received: from gateway (dialup-53 [195.17.73.53]) by tor.abc.se (8.9.3+Sun/8.9.3) with SMTP id OAA26964 for ; Thu, 12 Apr 2001 14:39:49 +0200 (MET DST) From: "Mattias Waldau" To: Subject: [Caml-list] How do I define prog1? Date: Thu, 12 Apr 2001 14:39:39 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20010412003442E.garrigue@kurims.kyoto-u.ac.jp> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I would like to define a (prog1 a b) which first evaluates a, then b, and returns the value of a. (Would be nice if I could have arbitrary number of args.) I defined it as let prog1 a b = a Works well in compiled code, first evaluates a, then b. However bytecode first evaluates b, then a. In this cases, call-by-name would be very nice. One obvious solution is to write let temp = a in b; temp but that is much too clumsy. /mattias ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr