unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Linas Vepstas <linasvepstas@gmail.com>
To: lchangying@gmail.com
Cc: guile-user@gnu.org
Subject: Re: why format procedure produce error?
Date: Wed, 11 Nov 2009 10:20:31 -0600	[thread overview]
Message-ID: <3ae3aa420911110820v68f47be2jfa742ee512a0bd56@mail.gmail.com> (raw)
In-Reply-To: <87my2tz3ma.fsf@gmail.com>

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 ?


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




  reply	other threads:[~2009-11-11 16:20 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 [this message]
2009-11-12  1:10   ` Changying Li
2010-08-28 20:45     ` Andy Wingo
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=3ae3aa420911110820v68f47be2jfa742ee512a0bd56@mail.gmail.com \
    --to=linasvepstas@gmail.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).