emacs-devel
[Top][All Lists]
Advanced

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

Re: Buffer names are sometimes read-only objects in daemonized emacs


From: Tassilo Horn
Subject: Re: Buffer names are sometimes read-only objects in daemonized emacs
Date: Fri, 30 Jul 2010 22:08:26 +0200
User-agent: KMail/1.13.5 (Linux/2.6.35-rc6-git4; KDE/4.4.5; x86_64; ; )

On Friday 30 July 2010 21:54:15 Wojciech Meyer wrote:
> Tassilo Horn <address@hidden>  writes:
> 
> > IMO a function shouldn't need to allow modification of it's return
> > value explicitly, but instead should warn if that's possible.  But
> > indeed, evaluating
> >
> >   (aset (buffer-name) 0 ?g)
> 
> How would you do this? I see that the check can be performed on only
> at runtime. Bytecompiler will not warn, because the value might be
> propagated, and Lisp is dynamicaly typed. (in simple cases like this
> it is apparent, but consider just returning this value from function).

No no, you got me wrong.  I just meant the docstring of `buffer-name'
(and any other function that returns some thing whose modification would
have undesired, non-obvious side-effects) should explicitly state that
modifying that returned string will indeed modify the buffer name.

Johan argued the other way round, that it's clear that you should not do
that because the function doesn't explicitly state that the returned
string is a fresh copy.

Bye,
Tassilo



reply via email to

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