Common Lisp マクロの種類
- macro form ; いわゆる「マクロ」
- (普通の)マクロ
- setf マクロ
- symbol macro
- reader macro
- (単一の) macro character
- dispatching macro character
- compiler macro
Common Lisp マクロの種類
lambda list の &aux の用途 | |
- 単純な関数やlambdaを短く書きたいときに | |
- 依存する dynamic 変数を lambda list に明示する | |
- lambda list にbindした変数の一部を取り出すため、近所にまとめたいとき | |
- もっとルーズに let のかわり |
(in-package :cl-user) | |
;;; これは、二回出てくる `#:hello' が別のシンボルなので、エラーになる。 | |
;; (flet ((#:hello () "Hello, World!")) | |
;; (#:hello)) | |
;; ; => Evaluation aborted on #<undefined-function @ #x105a7af3f2>. | |
;;; 一回目の `#:hello' を #n= と #n# で参照すればよい。 | |
(flet ((#1=#:hello () "Hello, World!")) | |
(#1#)) |
# MacOSXのHomebrewをアップデートした結果、OpenSSLが1.1系になって1.0系が使えなくなったけど、"Library not loaded: libcrypto.1.0.0.dylib issue in mac"とか出るのでOpenSSL 1.0系に戻したければ: | |
brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb --force | |
brew switch openssl 1.0.2t |
;; 接続が失われた後で slime-auto-select-connection を拒否すると以下が出る。 | |
Warning (slime): Caught error during fontification while searching for forms | |
that are suppressed by reader-conditionals. The error was: (error "No default connection selected."). |
(in-package :cl-user) | |
(defmacro with-repl-variables (&body body) | |
"BODY 中の式を、REPL 変数の `*', `+', `/', `-' 等を bind しながら順次実行する。" | |
(let ((form-results (gensym))) | |
`(let ((* *) (** **) (*** ***) | |
(+ +) (++ ++) (+++ +++) (- -) | |
(/ /) (// //) (/// ///)) | |
,@(loop for form in body | |
collect |
(quicklisp:quickload '(#:anaphora #:iterate #:cl-ppcre)) | |
(defpackage #:qldot | |
(:use #:cl #:iterate #:anaphora #:ppcre)) | |
(in-package #:qldot) | |
(defparameter *font* "Courier New") | |
(defmacro portname (sys &optional prj) |
* #{ -> ` -> #{ をネストできるように | |
* flet や handler-case や with-open-file で遊ぶと nest の例できそう | |
* struct 対応 | |
* vacietis に触れる |
====================================================================== | |
1 -> (slime-autodoc) | |
| 2 -> (slime-autodoc--parse-context) | |
| 2 <- slime-autodoc--parse-context: ("defun" "load-mock" ("config") ("declare" ("ignore" "config")) ("format" "*debug-io*" swank::%cursor-marker%)) | |
| 2 -> (slime-autodoc--cache-get ("defun" "load-mock" ("config") ("declare" ("ignore" "config")) ("format" "*debug-io*" swank::%cursor-marker%))) | |
| 2 <- slime-autodoc--cache-get: nil | |
| 2 -> (slime-background-activities-enabled-p) | |
| | 3 -> (slime-current-connection) | |
| | 3 <- slime-current-connection: #<process SLIME Lisp> | |
| | 3 -> (slime-busy-p) |
(in-package :cl-user) | |
#| | |
(ql:quickload :chirp) | |
(setf chirp:*oauth-api-key* "**************************" | |
chirp:*oauth-api-secret* "***************************" | |
chirp:*oauth-access-token* "*******************************" | |
chirp:*oauth-access-secret* "***************************") | |
|# |