all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: bug-gnu-emacs@gnu.org
Subject: bug#6486: documentation of `byte-code-function-p' should mention `symbol-function' and xref manual
Date: Mon, 21 Jun 2010 22:53:08 -0600	[thread overview]
Message-ID: <hvpfje$q81$1@dough.gmane.org> (raw)
In-Reply-To: <AANLkTimlkuL2QiytXMFA4uWF7FAhDMtg8SmqYqy4TML8@mail.gmail.com>

MON KEY wrote:
> The documentation of function `byte-code-function-p' should mention
> usage requires `symbol-function', and/or should refer to a relevant
> portion of the manual.
> 
> ,---- (documentation 'byte-code-function-p)
> |
> | Return t if OBJECT is a byte-compiled function object.
> |
> | (fn OBJECT)
> |
> `----
> 
> The above docs do not adequately indicate that the OBJECT arg is as
> per the return value of `symbol-function'. e.g.:
> 
>  (byte-code-function-p 'disassemble)
>  ;=> nil
> 
>  (byte-code-function-p (symbol-function 'disassemble))
>  ;=> t
> 
> How is the user supposed to know that OBJECT will only return t if it
> is the unreadable vector returned by `symbol-function'?

 From (elisp)What Is a Function:

    Unlike `functionp', the next three functions do _not_ treat a symbol
as its function definition.

  -- Function: subrp object
  ...
  -- Function: byte-code-function-p object

      This function returns `t' if OBJECT is a byte-code function.  For
      example:

           (byte-code-function-p (symbol-function 'next-line))
                => t

  -- Function: subr-arity subr
...

> Please add documentation of such, along with info node xref such as:
> 
>  See info node `(elisp) Byte-Code Objects'

Nah, that is why we have M-x elisp-index-search -- although it might
be nice if such links were automatically generated by the describe-*
commands.

> Also, note that the nature of the data-structure/readability of a
> byte-code'd function can not be deduced by the user by simply reading
> the manual section:
> 
>  (info "(elisp)What Is a Function")

The nature of several types can't be deduced by the node that describes
the corresponding predicate, but by the node that actually describes the
type (under the Programming Types or Editing Types node).

(elisp)What Is a Function does say:

"byte-code function"
      A "byte-code function" is a function that has been compiled by the
      byte compiler.  *Note Byte-Code Type::.

And (elisp)Byte-Code Type (referenced above) says:

    The printed representation and read syntax for a byte-code function
object is like that for a vector, with an additional `#' before the
opening `['.

-- 
Kevin Rodgers
Denver, Colorado, USA






  reply	other threads:[~2010-06-22  4:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21 17:36 bug#6486: documentation of `byte-code-function-p' should mention `symbol-function' and xref manual MON KEY
2010-06-22  4:53 ` Kevin Rodgers [this message]
2011-07-13 22:29   ` Lars Magne Ingebrigtsen
2010-06-22 21:56 ` MON KEY

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

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

  git send-email \
    --in-reply-to='hvpfje$q81$1@dough.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=bug-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.