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 NAA08281; Mon, 11 Jun 2001 13:21:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA08547 for caml-list@pauillac.inria.fr; Mon, 11 Jun 2001 13:20:59 +0200 (MET DST) 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 QAA28270 for ; Sun, 10 Jun 2001 16:06:38 +0200 (MET DST) Received: from localhost.localdomain (jimbo109.zip.com.au [202.7.67.109]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f5AE6Zj23527 for ; Sun, 10 Jun 2001 16:06:36 +0200 (MET DST) Received: from ozemail.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id AAA29291; Mon, 11 Jun 2001 00:06:29 +1000 Message-ID: <3B237EE5.80622A4C@ozemail.com.au> Date: Mon, 11 Jun 2001 00:06:29 +1000 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: David McClain CC: caml-list@inria.fr Subject: Re: [Caml-list] Evaluation Order References: <001501c0f139$9ce86640$210148bf@dylan> <000901c0f13b$f981c610$210148bf@dylan> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk David McClain wrote: > The results of these two operations, integers, are arithmetically commutable > under addition. But what isn't commutable is the order in which these > operations occur. No current type checking in OCaml (or any other language > with which I am familiar) could help catch this mistake. In principle, the Felix type checker would prevent this: side-effects are not permitted in functions. In practice, I had to relax the syntax permitted in functions, and the current translator doesn't check for side effects yet. You can also cheat, by wrapping C functions as Felix functions: there's no way to check if the C function has side effects or not. The reason for relaxing the rules is that it is very ugly and insecure to write things like: val x : int; // uninitialised variable! fetch(&x, &state_object); instead of val x : int = fetch(&state_object); I can't think of good way around this though. -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net ------------------- 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