From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 SAA02337 for ; Tue, 16 May 2000 18:01:56 +0200 (MET DST) Received: from mrwall.kal.com (mrwall.kal.com [194.193.14.236]) by concorde.inria.fr (8.10.0/8.10.0) with SMTP id e4GG1r500138 for ; Tue, 16 May 2000 18:01:53 +0200 (MET DST) Received: from mrwall.kal.com [194.193.14.236] (HELO localhost) by mrwall.kal.com (AltaVista Mail V2.0J/2.0J BL25J listener) id 0000_0051_3921_70ee_3e5f; Tue, 16 May 2000 17:01:50 +0100 Received: from somewhere by smtpxd Message-ID: <3145774E67D8D111BE6E00C0DF418B66226B86@nt.kal.com> From: Dave Berry To: Pierpaolo Bernardi , Frank Atanassow Cc: Markus Mottl , OCAML , Pierre.Weis@inria.fr, caml-redist@pauillac.inria.fr Subject: RE: The performance cost of using exceptions? Date: Tue, 16 May 2000 17:02:05 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain; charset="iso-8859-1" How about having a compiler that detects this pattern and emits the necessary pointer comparisons? Then you could write your code cleanly (without exceptions, flags or comparisons), and the compiler can emit whatever code is most efficient for its runtime. Dave. On Tue, 16 May 2000, Frank Atanassow wrote: > Markus Mottl writes: > the functional way would be to just return the subtree(s) intact, so there would > be no need to copy their spines. For this to work, you should either have a low-level pointer equality operator (present in OCaml, but not in other func. languages), or you must return a flag to signal whether the returned tree is unchanged.