From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: why format procedure produce error? Date: Sat, 28 Aug 2010 13:45:28 -0700 Message-ID: References: <87my2tz3ma.fsf@gmail.com> <3ae3aa420911110820v68f47be2jfa742ee512a0bd56@mail.gmail.com> <87aayszgwy.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1283028149 29977 80.91.229.12 (28 Aug 2010 20:42:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 28 Aug 2010 20:42:29 +0000 (UTC) Cc: guile-user@gnu.org To: lchangying@gmail.com Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Aug 28 22:42:28 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OpSEL-0000uo-IZ for guile-user@m.gmane.org; Sat, 28 Aug 2010 22:42:25 +0200 Original-Received: from localhost ([127.0.0.1]:45353 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OpSEL-0003qo-2u for guile-user@m.gmane.org; Sat, 28 Aug 2010 16:42:25 -0400 Original-Received: from [140.186.70.92] (port=41799 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OpSEF-0003pg-9l for guile-user@gnu.org; Sat, 28 Aug 2010 16:42:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OpSEB-0007UN-Ut for guile-user@gnu.org; Sat, 28 Aug 2010 16:42:19 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:62712 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OpSEB-0007UJ-T1 for guile-user@gnu.org; Sat, 28 Aug 2010 16:42:15 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 626AFD1D2D; Sat, 28 Aug 2010 16:42:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=o/1D7L1MDiEM z4NTLay4WfIzGTc=; b=QjBDeRDjeGOkHvGrrPbWWtgOciEPLZume/WDL8OB3VLe N4wB0uPyaDD+54O3bXmL/FcKl27jipJx679fLMm6d61hgH8OiEtsieTYWWem9zWL lKj/1A6Q+a6Wj9Zujjr3iE7gsdJIbFK+fG3uGw7eoKPOfbRm0Ck33bVsOxLlDOE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=rWkVgB SAwPaVAHshIt4Fd7Jqzvy8mVkuL3cpuJsoFAOt5cXk5PTlLT1kXoDRXL+dfspa7j Y96FkPFuWT4kzF9A9IAFxeWYcQsOJWp9cRRimGItR20BiqLwGwoHXV6kLgq+bWgU +ZS3YZfe10SzKODVvOosYswpfEDGc+QuVo0zo= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 4EB4AD1D2C; Sat, 28 Aug 2010 16:42:14 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [75.28.21.123]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id C6BC1D1D2B; Sat, 28 Aug 2010 16:42:12 -0400 (EDT) In-Reply-To: <87aayszgwy.fsf@gmail.com> (Changying Li's message of "Thu, 12 Nov 2009 09:10:53 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: BD51C4A4-B2E4-11DF-8448-030CEE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8112 Archived-At: Hi Changying, >> 2009/11/11 Changying Li : >>> in the guile manual: >>> =C2=A0-- Scheme Procedure: format dest fmt [args...] >>> =C2=A0 =C2=A0 Write output specified by the FMT string to DEST. =C2=A0D= EST can be an >>> =C2=A0 =C2=A0 output port, `#t' for `current-output-port' (*note Default >>> =C2=A0 =C2=A0 Ports::), a number for `current-error-port', or `#f' to r= eturn the >>> =C2=A0 =C2=A0 output as a string. >>> >>> what's the meaning of NUMBER? >>> I want to write things to error port, so I write >>> (format 1 "hello") >>> >>> standard input:5:1: In procedure simple-format in expression (format 1 = "hello"): >>> standard input:5:1: Wrong type argument in position 1: 1 >>> ABORT: (wrong-type-arg) >>> >>> >>> it work when I use (format (current-error-port) "hello") >>> >>> Is there something wrong in the guile manual ? No, this would work if you had loaded (ice-9 format). Guile's built-in format is not as full-featured as the scheme version. However passing a number to indicate current-error-port is silly, so I have deprecated that in master, and removed this piece from the documentation. Cheers, Andy --=20 http://wingolog.org/