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 VAA11286; Thu, 5 Dec 2002 21:47:33 +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 VAA11299 for ; Thu, 5 Dec 2002 21:47:32 +0100 (MET) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gB5KlUX06158 for ; Thu, 5 Dec 2002 21:47:31 +0100 (MET) Received: from tw304h3 oleg_inconnu@smtp-send.myrealbox.com [156.111.84.180] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 3.20 $ on Novell NetWare via secured & encrypted transport (TLS); Thu, 05 Dec 2002 13:47:30 -0700 Content-Type: text/plain; charset="us-ascii" From: Oleg To: caml-list@inria.fr Subject: [Caml-list] Why is (@) written in O'Caml? Date: Thu, 5 Dec 2002 15:47:09 -0500 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200212051547.09337.oleg_inconnu@myrealbox.com> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk let rec (@) l1 l2 =3D match l1 with [] -> l2 | hd :: tl -> hd :: (tl @ l2) The O'Caml implementation of (@) is recursive and not tail-recursive. All= one=20 really has to do during "append" is copy l1 and set the last element's CD= R to=20 l2. I can see why this can not be done in O'Caml itself, but since (@) is= =20 such a common operation, I'm wondering why it was decided to implement it= =20 inefficently in O'Caml itself? Cheers, Oleg ------------------- 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