From: Andy Wingo <wingo@pobox.com>
To: lchangying@gmail.com
Cc: guile-user@gnu.org
Subject: Re: why format procedure produce error?
Date: Sat, 28 Aug 2010 13:45:28 -0700 [thread overview]
Message-ID: <m3zkw61n6f.fsf@unquote.localdomain> (raw)
In-Reply-To: <87aayszgwy.fsf@gmail.com> (Changying Li's message of "Thu, 12 Nov 2009 09:10:53 +0800")
Hi Changying,
>> 2009/11/11 Changying Li <lchangying@gmail.com>:
>>> in the guile manual:
>>> -- Scheme Procedure: format dest fmt [args...]
>>> Write output specified by the FMT string to DEST. DEST can be an
>>> output port, `#t' for `current-output-port' (*note Default
>>> Ports::), a number for `current-error-port', or `#f' to return the
>>> 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
--
http://wingolog.org/
next prev parent reply other threads:[~2010-08-28 20:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-11 11:45 why format procedure produce error? Changying Li
2009-11-11 16:20 ` Linas Vepstas
2009-11-12 1:10 ` Changying Li
2010-08-28 20:45 ` Andy Wingo [this message]
2009-11-14 14:18 ` Neil Jerram
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3zkw61n6f.fsf@unquote.localdomain \
--to=wingo@pobox.com \
--cc=guile-user@gnu.org \
--cc=lchangying@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).