Skip to content

Instantly share code, notes, and snippets.

View y2q-actionman's full-sized avatar
🕹️
👾👾👾👾👾👾👾👾👾

Yokota Yuki y2q-actionman

🕹️
👾👾👾👾👾👾👾👾👾
View GitHub Profile
@y2q-actionman
y2q-actionman / memo.org
Last active March 6, 2020 02:52
Common Lisp マクロの種類

Common Lisp マクロの種類

  • macro form ; いわゆる「マクロ」
    • (普通の)マクロ
    • setf マクロ
  • symbol macro
  • reader macro
    • (単一の) macro character
    • dispatching macro character
  • compiler macro
@y2q-actionman
y2q-actionman / use_cases_of_lambda_list_aux.txt
Last active March 6, 2020 02:51
Common Lisp の lambda list の &aux の用途
lambda list の &aux の用途
- 単純な関数やlambdaを短く書きたいときに
- 依存する dynamic 変数を lambda list に明示する
- lambda list にbindした変数の一部を取り出すため、近所にまとめたいとき
- もっとルーズに let のかわり
@y2q-actionman
y2q-actionman / uninterned_hello.lisp
Created February 5, 2020 06:42
Uninterned symbol に flet してそれを呼ぶ
(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#))
@y2q-actionman
y2q-actionman / openssl100.sh
Created January 6, 2020 06:12
MacOSXのHomebrewをアップデートした結果、OpenSSLが1.1系になって1.0系が使えなくなったけど、"Library not loaded: libcrypto.1.0.0.dylib issue in mac"とか出るのでOpenSSL 1.0系に戻す
# 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
@y2q-actionman
y2q-actionman / emacs_slime_hangt.txt
Created March 7, 2019 03:34
ssh経由で slime が hang する件のメモ
;; 接続が失われた後で 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.").
@y2q-actionman
y2q-actionman / with-repl-variables.lisp
Last active June 21, 2019 02:35
repl 変数使えば anaphora いらんやん
(in-package :cl-user)
(defmacro with-repl-variables (&body body)
"BODY 中の式を、REPL 変数の `*', `+', `/', `-' 等を bind しながら順次実行する。"
(let ((form-results (gensym)))
`(let ((* *) (** **) (*** ***)
(+ +) (++ ++) (+++ +++) (- -)
(/ /) (// //) (/// ///))
,@(loop for form in body
collect
@y2q-actionman
y2q-actionman / qldot-systems.lisp
Created May 7, 2019 09:43 — forked from youz/qldot-systems.lisp
visualize dependencies in the quicklisp systems
(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)
@y2q-actionman
y2q-actionman / TODO
Last active March 19, 2019 16:06
with-c-syntax backquote
* #{ -> ` -> #{ をネストできるように
* flet や handler-case や with-open-file で遊ぶと nest の例できそう
* struct 対応
* vacietis に触れる
@y2q-actionman
y2q-actionman / trace1.txt
Created March 13, 2019 05:58
slime が時々通信に失敗して mode-line に数字が出たままになる。 slime-reset すると直るが・・
======================================================================
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)
@y2q-actionman
y2q-actionman / twitter-test.lisp
Last active March 7, 2019 03:39
twitter に所定の時間に自動投稿する
(in-package :cl-user)
#|
(ql:quickload :chirp)
(setf chirp:*oauth-api-key* "**************************"
chirp:*oauth-api-secret* "***************************"
chirp:*oauth-access-token* "*******************************"
chirp:*oauth-access-secret* "***************************")
|#