unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Pogonyshev <pogonyshev@gmail.com>
To: emacs-devel@gnu.org
Subject: Is byte-compiled code supposed to call `make-byte-code'?
Date: Tue, 24 May 2016 22:58:43 +0200	[thread overview]
Message-ID: <CAG7Bpaoq7iAgc3pgkPV2tYJAQceTBgUMLph_i9rcECa3rtVbAQ@mail.gmail.com> (raw)

Trying to disassemble a trivial function that invokes a closure:

(defun xxx (fn)
  (mapcar (lambda (x) (1+ (funcall fn x))) '(1 2 3)))
(disassemble 'xxx)

gives:

0       constant  mapcar
1       constant  make-byte-code
2       constant  257
3       constant  "\300\x01!T\207"
4       constant  vconcat
5       constant  vector
6       stack-ref 6
8       call      1
9       constant  []
10      call      2
11      constant  3
12      constant  "\n\n(fn X)"
13      call      5
14      constant  (1 2 3)
15      call      2
16      return

Is it supposed to build closure bytecode object every time? Shouldn't
it be considered a constant?

GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.3) of 2016-05-24

Paul



             reply	other threads:[~2016-05-24 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 20:58 Paul Pogonyshev [this message]
2016-05-24 21:19 ` Is byte-compiled code supposed to call `make-byte-code'? Andreas Schwab
2016-05-25  8:53   ` Paul Pogonyshev
2016-05-25 14:13     ` Stefan Monnier

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=CAG7Bpaoq7iAgc3pgkPV2tYJAQceTBgUMLph_i9rcECa3rtVbAQ@mail.gmail.com \
    --to=pogonyshev@gmail.com \
    --cc=emacs-devel@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 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).