From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: Re: why format procedure produce error? Date: Wed, 11 Nov 2009 10:20:31 -0600 Message-ID: <3ae3aa420911110820v68f47be2jfa742ee512a0bd56@mail.gmail.com> References: <87my2tz3ma.fsf@gmail.com> Reply-To: linasvepstas@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: ger.gmane.org 1257956455 7719 80.91.229.12 (11 Nov 2009 16:20:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Nov 2009 16:20:55 +0000 (UTC) Cc: guile-user@gnu.org To: lchangying@gmail.com Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Nov 11 17:20:48 2009 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.50) id 1N8Fw7-0001Ym-JX for guile-user@m.gmane.org; Wed, 11 Nov 2009 17:20:47 +0100 Original-Received: from localhost ([127.0.0.1]:59802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8Fw6-0004hg-PE for guile-user@m.gmane.org; Wed, 11 Nov 2009 11:20:46 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N8Fw1-0004dC-Lt for guile-user@gnu.org; Wed, 11 Nov 2009 11:20:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N8Fvw-0004PE-NM for guile-user@gnu.org; Wed, 11 Nov 2009 11:20:40 -0500 Original-Received: from [199.232.76.173] (port=50676 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N8Fvw-0004Nw-4H for guile-user@gnu.org; Wed, 11 Nov 2009 11:20:36 -0500 Original-Received: from mail-yw0-f194.google.com ([209.85.211.194]:39853) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N8Fvv-0006Z1-4p for guile-user@gnu.org; Wed, 11 Nov 2009 11:20:35 -0500 Original-Received: by ywh32 with SMTP id 32so1185955ywh.14 for ; Wed, 11 Nov 2009 08:20:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=iuDK0I/f/xTS/dKhmvXTLvWQCLc3r1nYRYEVmBeN3IE=; b=jSDW0NZjyIoMess0tI84FnQfmoEGq6jUjzvYAqmOu/dL1HFKHIqGcLQK7oz5nFKJdC MJS7sEwjDanT1XlGGlBHIWI/ycSyCqB9AT0nYEZIuRWUyzp3jMIGxSQjOe8wxkUWtMU1 gHEC6v48I/6+eITTiS+S+NOYnEYtlh6tpyzzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; b=lWtxbjPMAQdIIqCDPAFtMMB9haI2EsJ11Ciiq5+J1OykiZN+aebqbpsV+qNldIGZK0 q0Ek0VnA4Pc0nEhC5rduKsegV2G/Nji8LmIZ5RR1Yv/ouOFi6jNFie7LOjZBdVs8ZmKM wQ/D4ddtZ2gfrbgFuJgXEmftpAurtiHCRKDYA= Original-Received: by 10.101.106.24 with SMTP id i24mr1600332anm.141.1257956431485; Wed, 11 Nov 2009 08:20:31 -0800 (PST) In-Reply-To: <87my2tz3ma.fsf@gmail.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:7475 Archived-At: 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=A0DES= T 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 ret= urn 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 "h= ello"): > 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 ? That would be my guess. I assume that once upon a time, an integer was interpreted as a file or socket number, but that this code was later disabled, and the documentation was not changed. I guess that supporting fileno would have made an mswindows version difficult -- besides, raw fileno numbers are kind of a bad idea in this day and age. --linas