guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why format procedure produce error?


From: Andy Wingo
Subject: Re: why format procedure produce error?
Date: Sat, 28 Aug 2010 13:45:28 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Changying,

>> 2009/11/11 Changying Li <address@hidden>:
>>> 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/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]