From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: prj@po.cwru.edu (Paul Jarc) Newsgroups: gmane.lisp.guile.user Subject: Re: null terminated strings Date: Fri, 16 Jan 2004 15:36:03 -0500 Organization: What did you have in mind? A short, blunt, human pyramid? Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: <87oet4ntsm.fsf_-_@ID-28718.user.uni-berlin.de> <1074245327.6733.9.camel@localhost> <87u12wjiy7.fsf@ID-28718.user.uni-berlin.de> <1074250929.6734.63.camel@localhost> <87eku0f5em.fsf@ID-28718.user.uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1074285733 20510 80.91.224.253 (16 Jan 2004 20:42:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2004 20:42:13 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 16 21:42:09 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AhanA-0000EI-00 for ; Fri, 16 Jan 2004 21:42:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ahak8-0007bz-GD for guile-user@m.gmane.org; Fri, 16 Jan 2004 15:39:00 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AhaiZ-0007FI-6o for guile-user@gnu.org; Fri, 16 Jan 2004 15:37:23 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ahai1-00071q-6N for guile-user@gnu.org; Fri, 16 Jan 2004 15:37:20 -0500 Original-Received: from [129.22.104.63] (helo=harris.CNS.CWRU.Edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AhahK-0006pD-9M for guile-user@gnu.org; Fri, 16 Jan 2004 15:36:06 -0500 Original-Received: from conversion-daemon.smtp-a.cwru.edu by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) id <0HRL00401NQTAT@smtp-a.cwru.edu> for guile-user@gnu.org; Fri, 16 Jan 2004 15:36:05 -0500 (EST) Original-Received: from multivac.cwru.edu (multivac.ITS.CWRU.Edu [129.22.114.26]) by smtp-a.cwru.edu (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with SMTP id <0HRL003UCNW51E@smtp-a.cwru.edu> for guile-user@gnu.org; Fri, 16 Jan 2004 15:36:05 -0500 (EST) Original-Received: (qmail 30281 invoked by uid 500); Fri, 16 Jan 2004 20:36:27 +0000 In-reply-to: Original-To: Brian S McQueen Mail-followup-to: Brian S McQueen , guile-user@gnu.org Mail-Copies-To: nobody User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) Original-Lines: 22 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2621 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2621 Brian S McQueen wrote: > If the scheme string is truly null terminated, this can be greatly > simplified. Apparently, whether it is guaranteed to be terminated depends on what version of Guile you're using. With 1.6.4, it might not be terminated (judging by the fact that make-shared-substring exists in that version). But regardless of whether the guarantee is there in general, you can always make it so for a particular string using SCM_STRING_COERCE_0TERMINATION_X, as I showed before. Versions of Guile that guarantee termination can define that macro as a no-op to support existing code. FWIW, I think that (preferably copy-on-write) shared substrings are valuable enough for performance (not to mention backward compatibility) that Guile should not remove them for the sake of guaranteeing termination. With shared substrings, we can still get termination when we need it with SCM_STRING_COERCE_0TERMINATION_X, but without shared substrings, we cannot get performance when we need it. paul _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user