This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: converting to String in Kawa
- From: Per Bothner <per at bothner dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Sat, 24 Nov 2001 00:31:25 -0800
- Subject: Re: converting to String in Kawa
- References: <3BFC557E.4000201@bothner.com>
I checked in some patches that do
(a) change the <String> type (i.e. Type.tostring_type) so that it basically
is (x == null ? null : x.toString()) for a given input value x, with some
optimizations. (A future optimizations might be to define Scheme types
such as <string> as being implicitly non-null. In that case we could
leave out the test for null when converting a Scheme <string> to a <String>.
But for now the optimizations are for constant values and when x is
klnow to be a ,java.lang.String>.)
(b) I changed it so that the type <String> is used automatically when
passing
a argument to a Java method that expects a java.lang.String parameter.
This means that both the old and new behavior will work, though at the
cost of the test for null described in (a), except when it can be
optimzed away.
--Per