This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: New shared substring implementation


Christian Lynbech <chl@tbit.dk> writes:

> >>>>> "Mikael" == Mikael Djurfeldt <mdj@nada.kth.se> writes:
> 
> Mikael> [I understand Christian Lynbech's point, but the vast majority of
> Mikael> users want to have a simple system.  Those who want to use shared
> Mikael> substrings for communication can implement a specialized data
> Mikael> structure for this purpose.]
> 
> But would it be very hard to provide both? Ie. changing "ordinary"
> substrings to share more (using copy-on-write techniques) but still
> retaining the functionality of make-shared-substring under one form or
> another?

Technically, one would introduce a second type of shared substring.
String mutators would only coerce shared substring type 1 to a string.
Yes, probably this is easy to do.

Now, is it good for Guile?  I don't think so.  (Even though I'm a
sinner in this respect) I think it's important to keep Guile's user
interface simple.  I don't think the gain of enabling the user
to manipulate with sharedness of strings balances the cost of the
increased conceptual complexity added to the interface.

There are probably extremely few cases when you can write a good
program using shared substrings.  My guess is that in most candidate
cases it's a question of "tricky" programming which rather is a kind
of misuse of data structures, exploiting the properties of shared
substrings to achieve something which isn't "stringy" at all.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]