unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juanma Barranquero'" <lekktu@gmail.com>
Cc: 13052@debbugs.gnu.org
Subject: bug#13052: 24.3.50; mention recent change of `kbd' to a function in NEWS
Date: Sat, 1 Dec 2012 20:50:56 -0800	[thread overview]
Message-ID: <AA37D1F9312945F1B00DB664896C5B5B@us.oracle.com> (raw)
In-Reply-To: <CAAeL0SScN4zYH=2itiXB9subBzp=w+zUs=DfCzxhKc7atNaVsQ@mail.gmail.com>

> > The application of property `pure' to `kbd' is not in 
> > byte-opt.el.  It is in subr.el.  And in my code it would,
> > likewise, be in an ordinary Lisp library.
> 
> I wouldn't call subr.el "an ordinary Lisp library"; perhaps it's the
> word "basic" in "basic lisp subroutines for Emacs".

You can argue that merely by virtue of belonging to the GNU Emacs distribution
none of its libraries is completely "ordinary" - they are not user libraries.

I meant that it is not special wrt byte-compiling or the byte compiler (AFAIK).

If you want to say that wrt the use of `pure' it is more special than my library
`foo', then it behooves you to say what makes it special wrt byte-compiling.
That is my question.

> > I was just asking whether you know of something that makes 
> > this special to Emacs Dev and not appropriate for user
> > libraries.  If you don't know of anything, fine; perhaps
> > someone else does.
> 
> No, I don't know of something that makes it special to Emacs, other
> than the interiorities of the byte-optimizer are undocumented except
> in the source code. It's almost by definition what I would call
> "internal".

I was not asking what makes byte-opt.el special wrt byte-compiling.  I was
asking what makes subr.el - in particular, its definition of `kbd', special.

Why would it be appropriate to apply `pure' to `kbd' but not to a user function
`foo' with the same definition?  I'm trying to understand/learn.

> I suppose we will have to agree to disagree on this, because I don't
> share your impulse to document every nook and cranny of Emacs.

Hyperbole.  Let's please stick to this bug report and documentation of this
feature of applying property `pure'.

> > It is a question: whether `pure' is information that users 
> > can reasonably use to inform the byte compiler that a function
> > is what the compiler would expect of a pure function, i.e.,
> > what the code you pointed me to would expect, in order to
> > be able to perform that particular optimization.
> 
> If it were so, it would be documented, don't you think.

No, I don't think that is necessarily the case (`if it should be documented it
would already be documented').  Any more than the fact that the change of `kbd'
to a function is documented in NEWS.  That is a recent change, and perhaps
someone has just not yet had a chance to update NEWS.

Is the use of `pure' recent also?  Grepping Emacs 23.4 I find 4 occurrences
outside byte-opt.el (all in smie.el), so it is at least that old.  Grepping
Emacs 22.3 I find only one occurrence, which is in byte-opt.el itself.  Grepping
Emacs 21.3.1 I find no occurrences.

So it has been around for a while, but clearly it has not been used much so far,
even by Emacs Dev.  (The self-documentation of Emacs is for Emacs Dev too, BTW.)

> In the section of the Elisp manual dedicated to the
> byte-optimizer. Only that section does not exist.

There is a section that is about compiler declarations, but so far it is
specific to `declare-function'.  That seems to be the only compiler declaration
Emacs Lisp has, so far (?).

Perhaps the use of `pure', if appropriate for users (still my question), could
be elevated to a declaration form: `declare-pure' or whatever.

(And there are of course other user forms that affect byte compilation in some
way, such as `with-no-warnings'.)






  reply	other threads:[~2012-12-02  4:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-02  0:28 bug#13052: 24.3.50; mention recent change of `kbd' to a function in NEWS Drew Adams
2012-12-02  1:52 ` Juanma Barranquero
2012-12-02  2:18   ` Drew Adams
2012-12-02  2:26     ` Juanma Barranquero
2012-12-02  3:36       ` Drew Adams
2012-12-02  3:50         ` Juanma Barranquero
2012-12-02  4:07           ` Drew Adams
2012-12-02  4:19             ` Juanma Barranquero
2012-12-02  4:50               ` Drew Adams [this message]
2012-12-02 11:33     ` Michael Heerdegen
2012-12-02  9:14 ` Chong Yidong
2012-12-02 17:13   ` Drew Adams
2012-12-06 18:02   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AA37D1F9312945F1B00DB664896C5B5B@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=13052@debbugs.gnu.org \
    --cc=lekktu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).