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 RAA30882; Sun, 23 Feb 2003 17:30:17 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA31184 for ; Sun, 23 Feb 2003 17:30:16 +0100 (MET) Received: from KVIW14.KVI.nl (KVIW14.KVI.nl [129.125.15.46]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h1NGUGT00550 for ; Sun, 23 Feb 2003 17:30:16 +0100 (MET) Received: from KVIR52.KVI.nl ("port 2260"@KVIR52.KVI.nl [129.125.37.116]) by KVI.nl (PMDF V6.2 #30688) with ESMTP id <01KSSAEBGE3EC3SC4S@KVI.nl> for caml-list@inria.fr; Sun, 23 Feb 2003 17:29:42 +0100 (MET) Received: from KVIW15.KVI.nl by KVIR52.KVI.nl (AvMailGate-2.0.1.10) id 02845-02FBF05E; Sun, 23 Feb 2003 17:29:40 +0100 Received: from KVIP88.KVI.nl ("port 33357"@KVIP88.KVI.nl [129.125.15.152]) by KVI.nl (PMDF V6.2 #30688) with ESMTP id <01KSSADT5I9GC3SI0M@KVI.nl> for caml-list@inria.fr; Sun, 23 Feb 2003 17:29:17 +0100 (MET) Date: Sun, 23 Feb 2003 17:29:14 +0100 From: "Alexander S. Usov" Subject: [Caml-list] One question To: OCaml mailing list Message-id: <1046017748.12274.14.camel@kvip88.KVI.nl> Organization: KVI MIME-version: 1.0 X-Mailer: Ximian Evolution 1.2.1- (1.2.1-alt3) Content-type: text/plain Content-transfer-encoding: 7BIT Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi! Can anybody expalin me why in such code ------ type lex_node = Letter of char * bool * lex_tree and lex_tree = lex_node list ;; exceprion Already ;; let rec insert lex word = let whd = word.[0] and wtl = String.sub word 1 (String.length word - 1) in try match lex with | (Letter(c,b,t) as letter)::tail when (c <> whd) -> letter :: (insert tail word) | Letter(c,b,t) :: tail when (wtl = "") -> if b = true then raise Already else Letter(c,true,t) :: tail | Letter(c,b,t) :: tail -> Letter(c,b,(insert t wtl)) :: tail | [] -> if wtl = "" then [ Letter (whd, true, []) ] else [ Letter (whd, false, insert [] wtl) ] with | Already -> lex ;; let a = insert [] "word" in a == insert a "word" ;; ----- returns false? -- Best regards, Alexander. ------------------- 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