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 AAA02959; Wed, 15 Oct 2003 00:47:27 +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 AAA20788 for ; Wed, 15 Oct 2003 00:47:26 +0200 (MET DST) Received: from hotmail.com (law10-oe45.law10.hotmail.com [64.4.14.17]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9EMlP128409 for ; Wed, 15 Oct 2003 00:47:25 +0200 (MET DST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 14 Oct 2003 15:47:24 -0700 Received: from 141.149.237.84 by law10-oe45.law10.hotmail.com with DAV; Tue, 14 Oct 2003 22:47:23 +0000 X-Originating-IP: [141.149.237.84] X-Originating-Email: [bhavik_gandhi@hotmail.com] Reply-To: From: "Bhavik Gandhi \(hotmail\)" To: Subject: [Caml-list] Facing syntax error. Date: Tue, 14 Oct 2003 18:49:11 -0800 Message-ID: <000401c392c6$e9c5a550$0900a8c0@maverick> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0005_01C39283.DBA3EBF0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Importance: Normal X-OriginalArrivalTime: 14 Oct 2003 22:47:24.0077 (UTC) FILETIME=[226465D0:01C392A5] X-Loop: caml-list@inria.fr X-Spam: no; 0.00; ocaml:01 ocaml:01 rec:01 rec:01 syntax:02 syntax:02 match:02 match:02 novice:03 novice:03 tail:03 tail:03 let:04 let:04 arial:95 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C39283.DBA3EBF0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hi friends, I am a novice to the OCAML language. I am trying to write a small program and I am facing with a syntax error, any help will be appreciated let rec undup lst = try match lst with |[]->[] |h::tail -> match tail with |[]->[] |h::xt -> if (h=List.hd xt) then h::undup xt else raise(Failure "ERROR-Your list does not contain duplicates");; Error: line 6, characters 67-69 Syntax error. Bhavik Gandhi ------=_NextPart_000_0005_01C39283.DBA3EBF0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable

Hi friends,

 

I am a novice to the OCAML language. I am trying to = write a small program and I am facing with a syntax error, any help will be = appreciated

 

let rec undup lst =3D try match lst = with

  = |[]->[]

  |h::tail -> match tail = with

  = |[]->[]

  |h::xt -> if (h=3DList.hd xt) then h::undup = xt

  else raise(Failure "ERROR-Your list does not contain = duplicates");;

 

Error: line 6, characters = 67-69

Syntax = error.

 

 

Bhavik Gandhi

------=_NextPart_000_0005_01C39283.DBA3EBF0-- ------------------- 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