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 GAA14542; Sat, 21 Apr 2001 06:28:40 +0200 (MET DST) 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 GAA14609 for ; Sat, 21 Apr 2001 06:28:39 +0200 (MET DST) Received: from mailout05.sul.t-online.com (mailout05.sul.t-online.com [194.25.134.82]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3L4Sbv10614 for ; Sat, 21 Apr 2001 06:28:38 +0200 (MET DST) Received: from fwd01.sul.t-online.com by mailout05.sul.t-online.com with smtp id 14qp0P-00040A-01; Sat, 21 Apr 2001 06:28:21 +0200 Received: from pD901A161.dip.t-dialin.net (340009195196-0001@[217.1.161.97]) by fwd01.sul.t-online.com with esmtp id 14qp0I-0Us9RYC; Sat, 21 Apr 2001 06:28:14 +0200 Date: Sat, 21 Apr 2001 06:33:46 +0200 (CEST) From: markus.kliegl@t-online.de (markus.kliegl) To: David Brown cc: Caml List Subject: Re: [Caml-list] Random results In-Reply-To: <20010420211305.A7171@opus.davidb.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Sender: 340009195196-0001@t-dialin.net Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 20 Apr 2001, David Brown wrote: > > Ocaml appears to only have one copy of each string. When you rot13 the > string, it overwrite the constant. This toggles. > > An easy fix is to copy the string before changing the characters: > > let rot13_str str = > let str = String.copy str in > for i ... Works perfectly, thanks! Markus Kliegl ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr