GNU bug report logs - #7835
24.0.50; doc string of `overlay-put' needs to mention the return value

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Wed, 12 Jan 2011 22:42:02 UTC

Severity: minor

Tags: fixed

Found in version 24.0.50

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Drew Adams <drew.adams <at> oracle.com>, 7835 <at> debbugs.gnu.org
Subject: bug#7835: 24.0.50; doc string of `overlay-put' needs to mention the return value
Date: Tue, 05 Jul 2011 21:08:16 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>>>>> Like the Elisp manual, the doc string of `overlay-put' needs to mention
>>>>> that it returns its 3rd arg.
>>> Actually, the right fix would be to not document it.
>> Knowing that you're able to say
>>   (push (overlay-put ... ... (get-some-value)) list)
>> sounds useful to me.
>
> Looks like bad style to me.

I don't think so.  It's how setf and most mutators in Common Lisp
work, for instance:

MAINT> (setq table (make-hash-table))
#<EQL Hash Table{0} 402000AD6B>
MAINT> (setf (gethash :bar table) :foo)
:FOO

Or elisp put:

(put 'put 'foo 'bar)
=> bar

Now, you may consider `overlay-put' more like `insert', and not like a
`setf'-like mutator, but to me I'd be surprised if it didn't act like
these other mutators.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




This bug report was last modified 14 years and 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.