This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: How use formatted output in `print` method?
- From: Per Bothner <per at bothner dot com>
- To: Yaroslav Kavenchuk <kavenchuk at gmail dot com>
- Cc: kawa at sourceware dot org
- Date: Fri, 28 Dec 2007 12:17:47 -0800
- Subject: Re: How use formatted output in `print` method?
- References: <4774B70B.9070807@gmail.com>
Yaroslav Kavenchuk wrote:
In declaration
(define-simple-class <my-class> (<java.lang.Object> <gnu.text.Printable>)
...
((print out :: <gnu.lists.Consumer>) :: #!void
...))
this statements
(out:write (format #f ...))
and
(out:write (String (format #f ...)))
generate warnings.
How do it?
It would be helpful if you have a question you include
the actual error messages, and also a small complete
program we can run.
In this case, my guess is you might want:
(out:write (as <String> (format #f ...))))
It looks like a minor bug in Kawa - format in this case
returns an FString, but should perhaps return a java.lang.String,
now that Kawa has been changed to use the latter for non-modifyable
String.
--
--Per Bothner
per@bothner.com http://per.bothner.com/