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 MAA26455; Sun, 10 Jun 2001 12:40:28 +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 MAA26477 for ; Sun, 10 Jun 2001 12:40:27 +0200 (MET DST) Received: from kiste.thiemo.net (kiste.thiemo.net [193.159.181.84]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f5AAePL27029 for ; Sun, 10 Jun 2001 12:40:25 +0200 (MET DST) Received: (from jc@localhost) by kiste.thiemo.net (8.9.3/8.9.3) id MAA30201 for caml-list@inria.fr; Sun, 10 Jun 2001 12:40:20 +0200 (CEST) (envelope-from jc@joerch.org) Date: Sun, 10 Jun 2001 12:40:20 +0200 (CEST) Message-Id: <200106101040.MAA30201@kiste.thiemo.net> From: Joerg Czeranski MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: caml-list@inria.fr Subject: Re: [Caml-list] Evaluation Order In-Reply-To: <000901c0f13b$f981c610$210148bf@dylan> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk David McClain wrote: > My mistake was writing > > let ans = process_stream() + process_tail() > > [...] > > 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. A minor nit: commutativity isn't involved. The problem would be the same for let y = f() / g() and even let y = h (f()) (g()) Operators (and functions) just don't care in which order their operands (parameters) are evaluated. I really like Haskell's solution, but I've never used Haskell much. The main reasons for this is OCaml's superior Unix binding and it being much easier to build and install. jörg ------------------- 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