- Book "Land of Lisp"
- 09章-より進んだデータ型とジェネリックプログラミング
- 10章-loopマクロ
- 11章-format関数でテキストを表示する
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(declaim (optimize (debug 3))) | |
(defun last-element-p (lst) | |
(if (cdr lst) | |
t | |
nil)) | |
(defun add-elements (lst) | |
"非末尾呼び出し形式&非継続渡し形式" | |
(break) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gccでは...で表した可変長引数を__VA_ARGS__で指定できる | |
// 可変長引数を全て__VA_ARGS__とマップする | |
#define DEBUG_PRINT(...) printf(__VA_ARGS__); fflush(stdout) | |
// fmt以降の可変長引数を__VA_ARGS__とマップする | |
#define DEBUG_PRINT2(fmt, ...) printf(fmt, __VA_ARGS__); fflush(stdout) | |
// _1,_2,_3,の部分・・・引数の個数だけ用意する | |
// NAME・・・この部分に、目的の引数個数用の関数名が入る | |
#define GET_MACRO(_1,_2,_3,NAME,...) NAME |