「Common Lisp」の版間の差分

編集の要約なし
 
(同じ利用者による、間の2版が非表示)
32行目: 32行目:
</source>
</source>


関数の定義はdefunを使う。
関数の定義はdefunを使う。一個目の括弧内が引数だ。
<source lang="lisp">
<source lang="lisp">
(defun 関数名 (引数 引数 引数...) (処理) (処理) (処理) ...)
(defun 関数名 (引数 引数 引数 ...) (処理) (処理) (処理) ...)
</source>
</source>


最後の処理が戻り値になります。
関数の戻り値は「最後の処理」だ。
<source lang="lisp">
<source lang="lisp">
(defun example (x)
(defun example (x)
45行目: 45行目:


以上
以上
<amazon> Common LISP </amazon>


[[category: LISP]]
[[category: LISP]]