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 VAA17031; Fri, 30 Jan 2004 21:44:03 +0100 (MET) 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 VAA12121 for ; Fri, 30 Jan 2004 21:44:01 +0100 (MET) Received: from mail4.tpgi.com.au (mail.tpgi.com.au [203.12.160.61]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i0UKhxv04180 for ; Fri, 30 Jan 2004 21:43:59 +0100 (MET) Received: from syd-ts18-2600-163.tpgi.com.au (syd-ts18-2600-163.tpgi.com.au [203.58.21.163]) by mail4.tpgi.com.au (8.12.10/8.12.10) with ESMTP id i0UKhneX012684; Sat, 31 Jan 2004 07:43:50 +1100 Subject: Re: [Caml-list] ocaml and concurrency From: skaller Reply-To: skaller@tpg.com.au To: Brian Hurt Cc: Martin Berger , The Trade In-Reply-To: References: Content-Type: text/plain Message-Id: <1075495504.23595.64.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 31 Jan 2004 07:45:05 +1100 Content-Transfer-Encoding: 7bit X-TPG-Antivirus: Passed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 tpg:99 2004:99 theorist:01 theorist:01 currying:01 haskell:01 'g':01 abstraction:01 tpg:99 glebe:01 2037,:01 9660:01 ocaml:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 2004-01-30 at 17:52, Brian Hurt wrote: > On Fri, 30 Jan 2004, Martin Berger wrote: > > > > Perhaps because you're a type theorist? > > > > being a type theorist has many disadvantages ... > > > > > C not only *does* have function types, it has > > > first class function values just like ML does. > > > > well, i'm not so sure about this for two reasons. > > Technically, he's correct. What C doesn't have is partial function > application, If by that you mean currying .. well, of course C has that. If a function returns a function which returns a function you can curry exactly like in ML :-) > which makes having functional types much less worthwhile- > it's impossible for a function type to also contain state. Almost, but not quite true: int f(int x) { static int y = x; y = y + x; return x; } clearly does contain state.. the function isn't re-entrant though (which means merely not thread safe here since it manifestly isn't recursive). However it is true in Haskell and any purely functional Ocaml code .. they really cannot contain any state :-) Indeed, one can go further and say that ML functions are a lie: if you consider: let f x = let g y = y + x in g in let g1 = f 1 and g2 = f 2 then the two g's are distinction functions, they're NOT the 'g' defined in f, which in fact is NOT a function at all, merely an abstraction (of course g1 and g2 are functions .. :) -- John Max Skaller, mailto:skaller@tpg.com.au snail:25/85c Wigram Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850. Checkout Felix: http://felix.sf.net ------------------- 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