From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: doc string-pad string-pad-right Date: Wed, 09 Feb 2005 11:39:22 +1100 Message-ID: <87is52a7np.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1107909967 13676 80.91.229.2 (9 Feb 2005 00:46:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 9 Feb 2005 00:46:07 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Feb 09 01:46:06 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Cyfz2-0003cD-4Y for guile-devel@m.gmane.org; Wed, 09 Feb 2005 01:45:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cyg96-0002vZ-Bi for guile-devel@m.gmane.org; Tue, 08 Feb 2005 19:55:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cyg8u-0002rU-Sa for guile-devel@gnu.org; Tue, 08 Feb 2005 19:55:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cyg8f-0002jl-G8 for guile-devel@gnu.org; Tue, 08 Feb 2005 19:55:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cyg8f-0002jN-7D for guile-devel@gnu.org; Tue, 08 Feb 2005 19:55:29 -0500 Original-Received: from [61.8.0.84] (helo=mailout1.pacific.net.au) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cyftc-0005aN-5t for guile-devel@gnu.org; Tue, 08 Feb 2005 19:39:56 -0500 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87]) by mailout1.pacific.net.au (8.12.3/8.12.3/Debian-7.1) with ESMTP id j190dpA6006638 for ; Wed, 9 Feb 2005 11:39:51 +1100 Original-Received: from localhost (ppp2B17.dyn.pacific.net.au [61.8.43.23]) by mailproxy2.pacific.net.au (8.12.3/8.12.3/Debian-7.1) with ESMTP id j190do8v019597 for ; Wed, 9 Feb 2005 11:39:50 +1100 Original-Received: from gg by localhost with local (Exim 3.36 #1 (Debian)) id 1Cyft4-0001Ej-00; Wed, 09 Feb 2005 11:39:22 +1100 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org X-MailScanner-To: guile-devel@m.gmane.org Xref: main.gmane.org gmane.lisp.guile.devel:4763 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:4763 Where the doc for string-pad says it's "right-padded" it makes me think it does its padding on the right end, but in fact it's on the left. Maybe it was trying to say something like "right-justified" in the field. In any case I gave it and string-pad-right a bit of polish. The possible sharing described is per srfi-13. This had been saying the return was a "new string", but I'd like to quietly drop that in favour of what the srfi says. -- Scheme Procedure: string-pad s len [chr [start [end]]] -- Scheme Procedure: string-pad-right s len [chr [start [end]]] -- C Function: scm_string_pad (s, len, chr, start, end) -- C Function: scm_string_pad_right (s, len, chr, start, end) Take characters START to END from the string S and either pad with CHAR or truncate them to give LEN characters. `string-pad' pads or truncates on the left, so for example (string-pad "x" 3) => " x" (string-pad "abcde" 3) => "cde" `string-pad-right' pads or truncates on the right, so for example (string-pad-right "x" 3) => "x " (string-pad-right "abcde" 3) => "abc" The return string may share storage with S, or it can be S itself (if START to END is the whole string and it's already LEN characters). _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel