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 9250FBD73 for ; Tue, 16 Aug 2005 18:20:25 +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 j7GGKMQu006823 for ; Tue, 16 Aug 2005 18:20:23 +0200 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 SAA07922 for ; Tue, 16 Aug 2005 18:20:22 +0200 (MET DST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j7GGKLaQ021916 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 16 Aug 2005 18:20:22 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1E548s-0002Am-1u for caml-list@inria.fr; Tue, 16 Aug 2005 18:18:22 +0200 Received: from panic.cs.bris.ac.uk ([137.222.103.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Aug 2005 18:18:22 +0200 Received: from brown by panic.cs.bris.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Aug 2005 18:18:22 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Julian Brown Subject: Re: Snd question Date: Tue, 16 Aug 2005 16:16:49 +0000 (UTC) Organization: University of Bristol Message-ID: References: <161F0D30A699A84A8B7435B62BCE33B30360E19F@APS-MSG-01.southpacific.corp.microsoft.com> <43011A10.4090108@havenrock.com> <1124198264.13635.25.camel@localhost.localdomain> Reply-To: brown@cs.bris.ac.uk X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: panic.cs.bris.ac.uk User-Agent: slrn/0.9.8.1 (Debian) Sender: news X-Miltered: at concorde with ID 43021246.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43021245.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bris:01 anu:01 ocaml:01 arrays:01 wrote:01 wrote:01 sourceforge:01 pair:01 tuples:01 meant:05 elements:05 fst:06 snd:07 snd:07 generic:07 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 2005-08-16, skaller wrote: > > --===============0107267212== > Content-Type: multipart/signed; micalg=pgp-sha1; > protocol="application/pgp-signature"; > boundary="=-5lbpy9BGwsstOd4gLrxM" > > > --=-5lbpy9BGwsstOd4gLrxM > Content-Type: text/plain; charset=utf-8 > Content-Transfer-Encoding: quoted-printable > > On Mon, 2005-08-15 at 16:41 -0600, Matt Gushee wrote: >> Anu Engineer wrote: >>=20 >> > Please forgive me if my question is very na=C3=AFve, I am very new to=20 >> Ocaml. I was >>=20 >> > wondering why snd returns an error when I use it with more than 2=20 >> elements, why >>=20 >> > not return the rest of the list when I apply to something larger than=20 >> a pair ? >>=20 >>=20 >> Your question shows your misunderstanding: snd operates on tuples, not=20 >> lists.=20 > > I think the original question really meant: > > Why aren't "fst" and "snd" properly generic?? > > For example this simply *should* work: > > snd (1,2,3) What's wrong with arrays (or lists, for that matter), if you want to do this type of operation? Julian