原典 : https://blog.3qe.us/entry/2019/04/15/194201
わかる。正直いって全然わからん。
どうでもいい実験を書くときや、手元で動けばいいスクリプトを書くときには、そもそも defsystem を書いたりしない。
「CL:LOAD
で順に読む」というだけで十分なので。
(まあそもそも、 asdf がやってることも「いい感じに compile / load する」のだと考えられるが。)
(in-package :cl-user) | |
(defmacro power-assert (form) | |
(assert (listp form)) | |
(let ((op (first form)) | |
(result (gensym)) | |
binding | |
eval-form) | |
(assert (fboundp op) () | |
"Operator must be fbound. (op is ~A)" op) |
;;; 毎回 setf する (lambda と相性悪い) | |
(defmacro progn-$_ (&body forms) | |
`(let ($_) | |
,@(mapcar | |
(lambda (form) | |
`(setf $_ ,form)) | |
forms))) | |
#| | |
CL-USER> (progn-$_ 1 2 3) |
(in-package :cl-user) | |
(defmacro with-repl-variables (&body body) | |
"BODY 中の式を、REPL 変数の `*', `+', `/', `-' 等を bind しながら順次実行する。" | |
(let ((form-results (gensym))) | |
`(let ((* *) (** **) (*** ***) | |
(+ +) (++ ++) (+++ +++) (- -) | |
(/ /) (// //) (/// ///)) | |
,@(loop for form in body | |
collect |
* #{ -> ` -> #{ をネストできるように | |
* flet や handler-case や with-open-file で遊ぶと nest の例できそう | |
* struct 対応 | |
* vacietis に触れる |
#include <stdio.h> | |
#include <stdlib.h> | |
void __attribute__((noinline)) fizzbuzz_basic (void){ | |
int i; | |
for (i = 1; i <= 100; ++i) { | |
if (i % 15 == 0) { | |
printf("FizzBuzz\n"); | |
} else if (i % 3 == 0) { | |
printf("Fizz\n"); |
(in-package :cl-user) | |
(ql:quickload "split-sequence") | |
(defparameter *test-file* "/tmp/progv_test.csv") | |
(defun write-test-csv () | |
(with-open-file (out *test-file* :direction :output :if-does-not-exist :create | |
:if-exists :rename) | |
(format out "col1,col2,col3~%") |
#include <stdio.h> | |
/* | |
int main() { | |
int i; | |
for (i = 1; i <= 100; ++i) { | |
if (i % 15 == 0) { | |
printf("FizzBuzz\n"); | |
} else if (i % 3 == 0) { |
;; 接続が失われた後で 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."). |
====================================================================== | |
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) |
原典 : https://blog.3qe.us/entry/2019/04/15/194201
わかる。正直いって全然わからん。
どうでもいい実験を書くときや、手元で動けばいいスクリプトを書くときには、そもそも defsystem を書いたりしない。
「CL:LOAD
で順に読む」というだけで十分なので。
(まあそもそも、 asdf がやってることも「いい感じに compile / load する」のだと考えられるが。)