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 RAA08604; Wed, 10 Jul 2002 17:50:22 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA08600 for ; Wed, 10 Jul 2002 17:50:22 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6AFoJb10594 for ; Wed, 10 Jul 2002 17:50:20 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g6AFoDSs012797; Thu, 11 Jul 2002 01:50:13 +1000 (EST) Received: from ozemail.com.au (ppp210.dyn17.pacific.net.au [61.8.17.210]) by wisma.pacific.net.au with ESMTP id BAA27308; Thu, 11 Jul 2002 01:50:11 +1000 (EST) Message-ID: <3D2C57B2.4010907@ozemail.com.au> Date: Thu, 11 Jul 2002 01:50:10 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Michael Vanier CC: oleg_inconnu@myrealbox.com, caml-list@inria.fr Subject: Re: [Caml-list] productivity improvement References: <200207081952.PAA28813@hickory.cc.columbia.edu> <200207082014.g68KE0n02894@orchestra.cs.caltech.edu> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Michael Vanier wrote: >Imperative code in ocaml is not going to be massively different than >imperative code in any other (garbage-collected) language. > I don't agree. All imperative languages -- including ocaml -- contain functional parts, usually known as 'expressions'. The ability to write clear and simple imperative code is greatly enhanced by a powerful functional system precisely because it allows the imperative part of the language to be used just for imperative things. In a language like C the functional system is so weak, that one must use the imperative features just to implement purely functional constructions. For example, you cannot initialise a structure in C except with an imperative statement: X x = {1,2,3,4}; For example, you cannot encode a switch (other than over a bool) in an expression: you have a to use a statement, although you can wrap it in a function and call that .. although of course you lose your environment and so you need to pass them ... argggrgrgrg. Perhaps you can do better with: int x = expr; result = x==1 ? blah1() : x==2 ? blah2(): x==3 ? blah3(): ... As someone said recently "ocaml forever" :-)) -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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