[Top][All Lists]

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

Re: Kickstarter for Emacs

From: Stefan Monnier
Subject: Re: Kickstarter for Emacs
Date: Fri, 20 Apr 2012 22:46:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

>>> I'd happily contribute money to the development of the concurrency
>>> branch, the xembed work, or immutable strings/data structures.
>> Curious: what do you expect "immutable strings/data structures"
>> to provide?
> I have been thinking about implementing egal from Henry Baker's famous
> equality paper[1] in Emacs Lisp, but it is not very practical unless
> you can make certain guarantees of immutability.

My own local hacked version of Emacs has aset signal an error when
called on a string (and subst-char-in-string also signals as error when
called with `inplace').  I rarely bump into problems because of
this change.
But note that strings include text-properties, and I still allow those
to be changed.  Making them immutable would break more code (since
until `propertize' was added, all the text-properties were manipulated
by side-effects).
Now, `equal' does not pay attention to strings's text-properties, so
maybe my limited immutability would be good enough for `egal' (which is
really what we call `eql' if you think about it).

For `cons' cells, side-effects are used much too often in Elisp,
I wouldn't hold much hope for making them immutable.  So immutable cells
would have to be a new type (and car/cdr could be made to work with
them as well) with a new constructor (maybe named `icons' or `pair').

The problem still remains: what would be the benefit?


reply via email to

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