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 LAA27811; Thu, 18 Oct 2001 11:45:38 +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 LAA27848 for ; Thu, 18 Oct 2001 11:45:36 +0200 (MET DST) Received: from dido.engr.internet.org.ph ([203.176.75.250]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9I9jZb29303 for ; Thu, 18 Oct 2001 11:45:35 +0200 (MET DST) Received: by dido.engr.internet.org.ph (Postfix, from userid 502) id DDA171742A; Thu, 18 Oct 2001 17:44:10 +0800 (PHT) Date: Thu, 18 Oct 2001 17:44:10 +0800 From: "Rafael 'Dido' Sevilla" To: Caml List Subject: [Caml-list] getting the value of the first expression Message-ID: <20011018174410.A10054@team.ph.inter.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Mutt/1.2.5i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'm trying to write a simple compiler using Objective Caml, and what I can say is that it's been a far more pleasant experience than doing the same thing in C and Yacc, and I've learned a fair bit of the language this way. However there's one small thing I've wanted to do because it's needed in my compiler. Say I have a group of functions like this. emit_parm "ldc" offset; emit "ind" The value of this whole expression is the value of the emit application. What if I want the value of the entire expression to be the value of the emit_parm application? I can't interchange the order of these two expressions obviously because the two function applications have side effects (they generate the assembly language for my virtual machine architecture) Is there a way to do this? I've been able to work around my ignorance of the existence of such a feature but I can't help but feel that there *must* be a better way. One way I've thought of is to create a reference, but I can't help but feel that there's another way to do it. --=20 Rafael R. Sevilla +63(2) 8177746 ext. 8311 Programmer, Inter.Net Philippines +63(917) 4458925 http://dido.engr.internet.org.ph/ OpenPGP Key ID: 0x5CDA17D8 ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr