Re: [Scheme-reports] fresh empty strings Alaric Snell-Pym (23 Jan 2012 13:28 UTC)
Re: [Scheme-reports] fresh empty strings Andy Wingo (23 Jan 2012 15:23 UTC)
Re: [Scheme-reports] fresh empty strings Alaric Snell-Pym (23 Jan 2012 15:34 UTC)
Re: [Scheme-reports] fresh empty strings Ray Dillinger (23 Jan 2012 20:17 UTC)
Re: [Scheme-reports] fresh empty strings Andy Wingo (23 Jan 2012 20:52 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (23 Jan 2012 23:05 UTC)
Re: [Scheme-reports] fresh empty strings Vincent Manis (24 Jan 2012 01:02 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (24 Jan 2012 02:06 UTC)
Re: [Scheme-reports] fresh empty strings Alaric Snell-Pym (24 Jan 2012 09:37 UTC)
Re: [Scheme-reports] fresh empty strings John Cowan (24 Jan 2012 15:10 UTC)
Re: [Scheme-reports] fresh empty strings xacc.ide@gmail.com (24 Jan 2012 16:31 UTC)
Re: [Scheme-reports] fresh empty strings Per Bothner (24 Jan 2012 17:21 UTC)
Re: [Scheme-reports] fresh empty strings Andy Wingo (24 Jan 2012 17:00 UTC)
Re: [Scheme-reports] fresh empty strings Aubrey Jaffer (24 Jan 2012 02:16 UTC)

Re: [Scheme-reports] fresh empty strings Per Bothner 24 Jan 2012 17:19 UTC

On 01/24/2012 08:30 AM, xacc.ide@gmail.com wrote:
>> I was quite surprised by how many implementations take the trouble to
>> return true.
>
> What trouble? The underlying framework of my scheme does that for me :)
>
> I suspect the Java ones to be the same (due to string interning).
>
> One problem though is making sure
>
> (let ((a "foo")) (eq? a (string-copy a)))
>
> returns false.

You can use java.lang.String for Scheme string literals, in which
case Java does the interning for you.  But then you need to use some
other class for mutable strings - so it's not that simple!

(Kawa does use separate Java classes for mutable and immutable strings,
though it didn't used to - and I'm thinking about adding another class to
support O(1) indexing of strings containing non-basic-plane characters.)
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports