From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Emacs 24.0.94: With function argdesc bitstring, Elisp manual does not say how to get arg list Date: Thu, 30 Jun 2016 10:11:34 -0400 Message-ID: Reply-To: rswgnu@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1467296531 22834 80.91.229.3 (30 Jun 2016 14:22:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jun 2016 14:22:11 +0000 (UTC) Cc: 23873@debbugs.gnu.org, Stephen Berman To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 30 16:22:06 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bIcqu-0003tg-HP for ged-emacs-devel@m.gmane.org; Thu, 30 Jun 2016 16:22:00 +0200 Original-Received: from localhost ([::1]:50260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIcqq-0004RF-9C for ged-emacs-devel@m.gmane.org; Thu, 30 Jun 2016 10:21:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIchP-0005Fj-Nj for emacs-devel@gnu.org; Thu, 30 Jun 2016 10:12:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIchK-0002mv-PW for emacs-devel@gnu.org; Thu, 30 Jun 2016 10:12:10 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIchK-0002me-JG for emacs-devel@gnu.org; Thu, 30 Jun 2016 10:12:06 -0400 Original-Received: from mail-oi0-f45.google.com ([209.85.218.45]:35929) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bIchI-0003fD-Aw for emacs-devel@gnu.org; Thu, 30 Jun 2016 10:12:04 -0400 Original-Received: by mail-oi0-f45.google.com with SMTP id f189so66340080oig.3 for ; Thu, 30 Jun 2016 07:12:04 -0700 (PDT) X-Gm-Message-State: ALyK8tKC2ryv9xbxPqxFIcoMDWD46DRgf56JVUzs3AB+mxMFftSEEiG6cZUaaQF36tTTPbaTpVkWhFb+3X4fwg== X-Received: by 10.202.98.131 with SMTP id w125mr8837987oib.32.1467295923339; Thu, 30 Jun 2016 07:12:03 -0700 (PDT) Original-Received: by 10.202.212.143 with HTTP; Thu, 30 Jun 2016 07:11:34 -0700 (PDT) X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204984 Archived-At: Is there a Lisp function to extract the argument list of a byte-coded function when it uses the bitstring arg descriptor in its first element (see below for the Elisp manual doc on this)? I would suggest that the documentation be updated to describe how to get the argument signature in this situation, as it is silent on that. This has come up when a standard function was advised and we need to get its argument list for some code handling. Thanks, Bob --------- Internally, a byte-code function object is much like a vector; its elements can be accessed using =E2=80=98aref=E2=80=99. Its printed represe= ntation is like that for a vector, with an additional =E2=80=98#=E2=80=99 before the o= pening =E2=80=98[=E2=80=99. It must have at least four elements; there is no maximum number, but only the first six elements have any normal use. They are: ARGDESC The descriptor of the arguments. This can either be a list of arguments, as described in *note Argument List::, or an integer encoding the required number of arguments. In the latter case, the value of the descriptor specifies the minimum number of arguments in the bits zero to 6, and the maximum number of arguments in bits 8 to 14. If the argument list uses =E2=80=98&rest=E2=80=99, then bit = 7 is set; otherwise it=E2=80=99s cleared. If ARGDESC is a list, the arguments will be dynamically bound before executing the byte code. If ARGDESC is an integer, the arguments will be instead pushed onto the stack of the byte-code interpreter, before executing the code.