May 31th Thursday (五月 三十一日 木曜日)

来源:互联网 发布:java语言和c语言的区别 编辑:程序博客网 时间:2024/04/30 19:39

  -- Function: byte-compile symbol

   This function byte-compiles the function definition of SYMBOL, replacing the previous definition with the
compiled one.  The function definition of SYMBOL must be the actual code for the function; i.e., the compiler does
not follow indirection to another symbol.  'byte-compile' returns the new, compiled definition of SYMBOL.

  If SYMBOL's definition is a byte-code function object, 'byte-compile' does nothing and returns 'nil'.  Lisp
records only one function definition for any symbol, and if that is already compiled, non-compiled code is not
available anywhere.  So there is no way to "compile the same definition again."

          (defun factorial (integer)
            "Compute factorial of INTEGER."
            (if (= 1 integer) 1
              (* integer (factorial (1- integer)))))
          => factorial

          (byte-compile 'factorial)
          =>
          #[(integer)
            "^H/301U/203^H^@/301/207/302^H/303^HS!/"/207"
            [integer 1 * factorial]
            4 "Compute factorial of INTEGER."]

  The result is a byte-code function object.  The string it contains is the actual byte-code; each character in
it is an instruction or an operand of an instruction.  The vector contains all the constants, variable names and
function names used by the function, except for certain primitives that are coded as special instructions.

  If the argument to 'byte-compile' is a 'lambda' expression, it returns the corresponding compiled code, but does
not store it anywhere.

  -- Command: byte-recompile-directory directory &optional flag force This command recompiles every '.el' file in
DIRECTORY (or its subdirectories) that needs recompilation.  A file needs recompilation if a '.elc' file exists but
is older than the '.el' file.

  When a '.el' file has no corresponding '.elc' file, FLAG says what to do.  If it is 'nil', this command ignores
these files.  If FLAG is 0, it compiles them.  If it is neither 'nil' nor 0, it asks the user whether to compile
each such file, and asks about each subdirectory as well.

  Interactively, 'byte-recompile-directory' prompts for DIRECTORY and FLAG is the prefix argument.

  If FORCE is non-'nil', this command recompiles every '.el' file that has a '.elc' file.

  The returned value is unpredictable.

  -- Function: batch-byte-compile &optional noforce
  This function runs `byte-compile-file' on files specified on the command line.  This function must be used only
in a batch execution of Emacs, as it kills Emacs on completion.  An error in one file does not prevent processing
of subsequent files, but no output file will be generated for it, and the Emacs process will terminate with a nonzero
status code.

  If NOFORCE is non-'nil', this function does not recompile files that have an up-to-date '.elc' file.

          % emacs -batch -f batch-byte-compile *.el

  -- Function: byte-code code-string data-vector max-stack
  This function actually interprets byte-code.  A byte-compiled function is actually defined with a body that calls
'byte-code'.  Don't call this function yourself--only the byte compiler knows how to generate valid calls to this function.

   In Emacs version 18, byte-code was always executed by way of a call to the function 'byte-code'.  Nowadays, byte-code
is usually executed as part of a byte-code function object, and only rarely through an explicit call to `byte-code'.