次: , 前: Macro Forms, 上: Forms


8.2.7 スペシャルフォーム

スペシャルフォーム(special form)は、 その引数を評価しないように特別な印が付いた基本関数です。 ほとんどのスペシャルフォームは、制御構造を定義したり、 変数を束縛したりします。 これらはどれも関数ではできないことです。

各スペシャルフォームには、どの引数は評価し、 どの引数は評価せずに使うかといったそれぞれに独自の規則があります。 特定の引数を評価するかどうかは、他の引数の評価結果に依存することもあります。

以下に、Emacs Lispのすべてのスペシャルフォームをアルファベット順に、 参照箇所とともにあげておきます。

and
see Combining Conditions
catch
see Catch and Throw
cond
see Conditionals
condition-case
see Handling Errors
defconst
see Defining Variables
defmacro
see Defining Macros
defun
see Defining Functions
defvar
see Defining Variables
function
see Anonymous Functions
if
see Conditionals
interactive
see Interactive Call
let
let*
see Local Variables
or
see Combining Conditions
prog1
prog2
progn
see Sequencing
quote
see Quoting
save-current-buffer
see Current Buffer
save-excursion
see Excursions
save-restriction
see Narrowing
save-window-excursion
see Window Configurations
setq
see Setting Variables
setq-default
see Creating Buffer-Local
track-mouse
see Mouse Tracking
unwind-protect
see Nonlocal Exits
while
see Iteration
with-output-to-temp-buffer
see Temporary Displays

Common Lispに関した注意: GNU Emacs LispとCommon Lispのスペシャルフォームを比較してみる。 setqif、および、catchは、Emacs Lispでも Common Lispでもスペシャルフォームである。 defunは、Emacs Lispではスペシャルフォームであるが、 Common Lispではマクロである。 save-excursionは、Emacs Lispではスペシャルフォームであるが、 Common Lispには存在しない。 throwは、Common Lispでは(複数の値を返す必要があるため) スペシャルフォームであるが、 Emacs Lispでは(複数の値はないため)関数である。