[Top][All Lists]

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

Re: Guile: What's wrong with this?

From: David Kastrup
Subject: Re: Guile: What's wrong with this?
Date: Fri, 06 Jan 2012 10:23:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Mike Gran <address@hidden> writes:

>> `define' merely makes a new reference to an existing object.  If you
>> want a copy, you must explicitly ask for one (though this could be
>> hidden by custom syntax).  It would not be desirable for the language to
>> make copies automatically as part of the core `define' syntax.  For one
>> thing, sometimes you don't want a copy.  Sometimes you want shared
>> mutable objects.
> It is curious that action of 'copy' really means the
> action of 'create a copy with different properties'.
> Shouldn't (string-copy "a") create another immutable string?

That would be rather pointless.  You could just use the original string.

> Likewise, shouldn't (substring "abc" 1) return an immutable substring?

Why wouldn't you be using substring/shared if you are not going to
modify either string?

David Kastrup

reply via email to

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