GNU bug report logs - #13823
24.3.50; Elisp manual description of property `pure'

Previous Next

Package: emacs;

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

Date: Tue, 26 Feb 2013 19:46:02 UTC

Severity: wishlist

Found in version 24.3.50

Done: Christopher Schmidt <christopher <at> ch.ristopher.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13823 in the body.
You can then email your comments to 13823 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Tue, 26 Feb 2013 19:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 Feb 2013 19:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.3.50; Elisp manual description of property `pure'
Date: Tue, 26 Feb 2013 11:43:34 -0800
The doc for property `pure' is inadequate and misleading.  It says only
this:
 
  `pure'
     This property is used internally to mark certain named functions
     for byte compiler optimization.  Do not set it.
 
In discussion of bug #13052, no good reason was given for this.
 
The consideration of this property as somehow being "internal", and not
for use by anyone programming with Emacs Lisp other than those
developing core Emacs, is misguided.  Users deserve a real description
of what this property does, so they can determine whether and where to
use it in code they develop.
 
The same information would of course be useful to core Emacs developers
- the manual serves them too.
 
The idea of withholding such information from users is misguided.  All
users are potentially Emacs-Lisp users and even potentially core Emacs
developers.  The Elisp manual should say what such a property actually
does, specifically.
 
AFAICT, there is no difference between using this property in code
distributed as part of core Emacs and using it in other, user code.
 
Why shouldn't, for example, a user function with a definition similar
to, or even identical to, that for `kbd' have `pure' applied to it,
since it is applied to `kbd'?  Why make users guess when `pure' might be
appropriate or inappropriate?
 
Emacs Dev really needs to get over its antiquated conception of Emacs
users as something other than Emacs-Lisp developers.  The world has
moved beyond end users submitting batch requests at the Univac job
queue.
 
GNU should be in the vanguard of putting users first and encouraging
them to dig into, understand, and modify the programs that GNU provides.
Shame on GNU for not helping users by making things more transparent.

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-02-25 on ODIEONE
Bzr revision: 111879 yamaoka <at> jpl.org-20130225224731-cv9gznq5nqf3ei7g
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib'
 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Tue, 26 Feb 2013 21:07:02 GMT) Full text and rfc822 format available.

Message #8 received at 13823 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 13823 <at> debbugs.gnu.org
Subject: Re: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Tue, 26 Feb 2013 16:04:14 -0500
> The idea of withholding such information from users is misguided.

You'd be well served to stop constantly assuming that we're intent on
withholding things (and breaking and whatever else happens to you poor
users).

If you can come up with a good description of what it does, I'm
all ears.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Tue, 26 Feb 2013 21:17:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christopher Schmidt <christopher <at> ch.ristopher.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Tue, 26 Feb 2013 21:13:57 +0000 (GMT)
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
> If you can come up with a good description of what it does, I'm
> all ears.

There is a nice description of pure in byte-opt.el

    ;; pure functions are side-effect free functions whose values depend
    ;; only on their arguments. For these functions, calls with constant
    ;; arguments can be evaluated at compile time. This may shift run
    ;; time errors to compile time.

        Christopher (<- who would like to see pure documented)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Tue, 26 Feb 2013 21:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 13823 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Stefan Monnier'" <monnier <at> iro.umontreal.ca>
Cc: 13823 <at> debbugs.gnu.org
Subject: RE: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Tue, 26 Feb 2013 13:56:16 -0800
> If you can come up with a good description of what
> it does, I'm all ears.

You presumably know the content to be communicated - just what effect property
`put' has, when to use it, any gotchas or other things to be aware of etc.

I do not really know.  I'm asking for precisely that info.

If you tell me the content - what `put' does, I will be more than glad to offer
help with the wording.


From the bug #13052 thread, it seems that this might be the effect and condition
of use, but please correct if wrong:

 Non-nil means that when the symbol's function is
 called with only constant arguments the byte-compiler
 evaluates the call and replaces it in the compiled
 code by its value.[*]

 This is similar to replacing a macro call by the
 evaluation of its expansion.

 Use `put' only when the function has no side effects
 and every evaluation of that function call returns
 the same value regardless of the evaluation context.

[*] Does the byte-compiler always do this when the condition is satisfied?  Or
does non-nil `pure' mean only that it might do this?


Is the above description correct?  Should something else be said?

Perhaps the condition is too strong?  Is there a use case for a function that
might not give the same result in all contexts, but for which the only
relevant/intended context is byte-compilation?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Wed, 27 Feb 2013 01:27:03 GMT) Full text and rfc822 format available.

Message #17 received at 13823 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 13823 <at> debbugs.gnu.org
Subject: Re: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Tue, 26 Feb 2013 20:24:36 -0500
>> If you can come up with a good description of what it does, I'm all ears.
> You presumably know the content to be communicated - just what effect
> property `put' has, when to use it, any gotchas or other things to be
> aware of etc.

That's a wrong presumption.  Rather than presuming, please stick to
the facts and go straight to the point.
E.g. ask "Could we have it be properly documented, please?".


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Wed, 27 Feb 2013 01:29:04 GMT) Full text and rfc822 format available.

Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Tue, 26 Feb 2013 20:27:05 -0500
>> If you can come up with a good description of what it does, I'm all ears.
> There is a nice description of pure in byte-opt.el
>     ;; pure functions are side-effect free functions whose values depend
>     ;; only on their arguments.  For these functions, calls with constant
>     ;; arguments can be evaluated at compile time.  This may shift run
>     ;; time errors to compile time.

Sounds OK.  Feel free to put it in.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Wed, 27 Feb 2013 04:41:01 GMT) Full text and rfc822 format available.

Message #23 received at 13823 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Stefan Monnier'" <monnier <at> iro.umontreal.ca>
Cc: 13823 <at> debbugs.gnu.org
Subject: RE: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Tue, 26 Feb 2013 20:38:49 -0800
> go straight to the point.  E.g. ask "Could we have it
> be properly documented, please?".

Oh, that's just what I did, in bug #13052:

>> How about documenting this `pure' property?

and later in that same thread:

>> In any case, this property should be documented.

Another user agreed and added that "We can be happy that [Emacs Dev does not
just tell users] `Do not use this'."

To which, ironically, the response was in fact to "document" it by just telling
users "Do not set it."

Bug #13823 is an attempt to get beyond that reaction constructively.

You asked me to come up with a description of what it does.  I proposed some
text based on my understanding, inviting correction.  Dunno whether you even
read it.

Your response was to tell me I should not assume you know more about this than
I, and that I should anyway just ask that it be properly documented.  So one
more time:

"Could we have it be properly documented, please?"

It is the only standard symbol property listed in (elisp) `Standard Properties'
about which we say virtually nothing and for which there is no cross reference
to a section that covers it.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13823; Package emacs. (Wed, 27 Feb 2013 14:30:10 GMT) Full text and rfc822 format available.

Message #26 received at 13823 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 13823 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Wed, 27 Feb 2013 09:27:47 -0500
Since the Emacs source code is published free software,
it is impossible for us to "withhold" any information about it.

-- 
Dr Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org  www.gnu.org
Skype: No way! That's nonfree (freedom-denying) software.
  Use Ekiga or an ordinary phone call





Reply sent to Christopher Schmidt <christopher <at> ch.ristopher.com>:
You have taken responsibility. (Sun, 17 Mar 2013 16:57:02 GMT) Full text and rfc822 format available.

Notification sent to "Drew Adams" <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Sun, 17 Mar 2013 16:57:03 GMT) Full text and rfc822 format available.

Message #31 received at 13823-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Schmidt <christopher <at> ch.ristopher.com>
To: 13823-done <at> debbugs.gnu.org
Subject: Re: bug#13823: 24.3.50; Elisp manual description of property `pure'
Date: Sun, 17 Mar 2013 16:55:01 +0000 (GMT)
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> Sounds OK.  Feel free to put it in.

I did this, r112066.

        Christopher




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 15 Apr 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 34 days ago.

Previous Next


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