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 AAA16901; Wed, 21 Jan 2004 00:48:35 +0100 (MET) 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 AAA16943 for ; Wed, 21 Jan 2004 00:48:34 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from eposta.kablonet.com.tr ([62.248.102.66]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id i0KNmVP08587 for ; Wed, 21 Jan 2004 00:48:32 +0100 (MET) Received: (qmail 88362 invoked by uid 0); 20 Jan 2004 23:55:21 -0000 Received: from unknown (HELO 195.174.173.82) (exa@kablonet.com.tr@195.174.173.82) by 0 with SMTP; 20 Jan 2004 23:55:21 -0000 From: Eray Ozkural Reply-To: erayo@cs.bilkent.edu.tr Organization: Bilkent University CS Dept. To: Ocaml Mailing List Subject: Re: [Caml-list] ANNOUNCE: mod_caml 1.0.6 - includes security patch Date: Wed, 21 Jan 2004 01:48:19 +0200 User-Agent: KMail/1.5.94 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200401210148.20003.exa@kablonet.com.tr> X-Loop: caml-list@inria.fr X-Spam: no; 0.00; eray:01 ozkural:01 caml-list:01 2004:99 00,:99 admittedly:01 terrible:01 eray:01 ozkural:01 erayo:01 bilkent:01 bilkent:01 ankara:01 kde:01 kde:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wednesday 21 January 2004 01:00, Brian Hurt wrote: > That peice of code would be equivelent to: > let _ = > let x = g () in > f x > ;; > > So precision isn't lost, just hidden. > > I would think the following might be more of a problem: > > let x = ... ;; > > let _ = f x > (* at this point, does the compiler know which x to use? *) > where x = g () > ;; > Compiler knows which x to use, let and which differ only in syntax! Semantics is the same. > Even more hideous possibilities arise: > > let rec f x = > let x = f (x + 3) > in > f (2 * x) > where f x = 2 + (f x) > and x = 3 > ;; > > I admit that I can't follow which fs and which xs are which, and what the > result of that function would be (it'd be typed int -> int, that is > clear). Even a simple question like "does f 3 even terminate?" is not at > all obvious, let alone what answer it'd return. > [snip] Yes, admittedly, it's a terrible code :) However, I will unfortunately have to insist that "where" is neither redundant nor error prone. It's one of the most elegant syntactic sugar's I've seen in a long long while. Especially when you are writing down a mathematical formulae, it makes things clearer. Putting every little variable in module scope isn't a substitute for me. What I meant was that the absence of "where" in ocaml does not seem to me "by design" as another poster claimed. Ocaml is not (and quite possibly cannot be) the perfect language although it is the best programming language IMHO!!!! Cheers, -- Eray Ozkural (exa) Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- 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