From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 995BEBDCB for ; Sat, 20 Aug 2005 16:29:04 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7KET3sN013227 for ; Sat, 20 Aug 2005 16:29:03 +0200 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 QAA01810 for ; Sat, 20 Aug 2005 16:29:02 +0200 (MET DST) Received: from conn.mc.mpls.visi.com (conn.mc.mpls.visi.com [208.42.156.2]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j7KET2sO013224 for ; Sat, 20 Aug 2005 16:29:02 +0200 Received: from [192.168.42.2] (bhurt.dsl.visi.com [208.42.141.66]) by conn.mc.mpls.visi.com (Postfix) with ESMTP id 2BF4681D2; Sat, 20 Aug 2005 09:29:01 -0500 (CDT) Date: Sat, 20 Aug 2005 09:31:40 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: skaller Cc: Matt Gushee , caml-list@inria.fr Subject: Re: [Caml-list] Snd question In-Reply-To: <1124198264.13635.25.camel@localhost.localdomain> Message-ID: References: <161F0D30A699A84A8B7435B62BCE33B30360E19F@APS-MSG-01.southpacific.corp.microsoft.com> <43011A10.4090108@havenrock.com> <1124198264.13635.25.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at concorde with ID 43073E2F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43073E2E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 associative:01 arrays:01 ocaml:01 ocaml:01 arrays:01 2005,:98 hammer:98 hammer:98 wrote:01 overlap:01 rewrite:01 structures:01 structures:01 tuples:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Tue, 16 Aug 2005, skaller wrote: > I think the original question really meant: > > Why aren't "fst" and "snd" properly generic?? Sorry for joining the discussion late, but I question the need for fst and snd in general. Whenever I find I'm using these functons regularly, I find that I'm using tuples when I should be using structures. This is especially the case when I'm future proofing the data structure, i.e. I want to be able to add fields later on without having to rewrite all the code. This is one of the things I like about Ocaml- the lack of golden hammers, but the rich variety of tools available. A lot of languages do seem to have golden hammer data structures especially- consider lists in Lisp or associative arrays in Perl. The sure sign of a golden hammer data structure is that it's the one you pick if you're not sure what data structure you need. Now, Ocaml doesn't have one. Ocaml doesn't have any one single data structure which is always the right one. Tuples, structures, objects, variant types, arrays, and lists all have some overlap, and some unique features. There is no golden hammer, but there is a rich and powerful enough set of tools that I've yet to see a situation where the right tool for the job wasn't at hand. Brian