Skip to content

Instantly share code, notes, and snippets.

🕹
👾👾👾👾👾👾👾👾👾

YOKOTA Yuki y2q-actionman

🕹
👾👾👾👾👾👾👾👾👾
Block or report user

Report or block y2q-actionman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@y2q-actionman
y2q-actionman / memo.org
Last active Sep 4, 2019
Common Lisp マクロの種類
View memo.org
  • macro form ; いわゆる「マクロ」
    • (普通の)マクロ
    • setf マクロ
  • symbol macro
  • reader macro
    • (単一の) macro character
    • dispatching macro character
  • compiler macro
@y2q-actionman
y2q-actionman / qldot-systems.lisp
Created May 7, 2019 — forked from youz/qldot-systems.lisp
visualize dependencies in the quicklisp systems
View qldot-systems.lisp
(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 / feel_about_asdf.md
Last active Apr 23, 2019
(ご意見募集)Common LispのASDF3のここが気に入らない・難しい に向けて
View feel_about_asdf.md

原典 : https://blog.3qe.us/entry/2019/04/15/194201

ASDF難しい

わかる。正直いって全然わからん。

どうでもいい実験を書くときや、手元で動けばいいスクリプトを書くときには、そもそも defsystem を書いたりしない。 「CL:LOAD で順に読む」というだけで十分なので。 (まあそもそも、 asdf がやってることも「いい感じに compile / load する」のだと考えられるが。)

@y2q-actionman
y2q-actionman / trace1.txt
Created Mar 13, 2019
slime が時々通信に失敗して mode-line に数字が出たままになる。 slime-reset すると直るが・・
View trace1.txt
======================================================================
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 / emacs_slime_hangt.txt
Created Mar 7, 2019
ssh経由で slime が hang する件のメモ
View emacs_slime_hangt.txt
;; 接続が失われた後で 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 / fizzbuzz.c
Created Jan 31, 2019
C と lisp で fizzbuzz 比較
View fizzbuzz.c
#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) {
@y2q-actionman
y2q-actionman / progv_test.lisp
Created Jan 25, 2019
progv を使って csv ヘッダを変数名として取り込んでループ回す
View progv_test.lisp
(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~%")
@y2q-actionman
y2q-actionman / basic.c
Created Jan 11, 2019
最速 fizzbuzz に sendfile や tee を使おうと思ったけど、端末にはどちらも使えず pipe で cat とかに繋ぐ必要があって残念
View basic.c
#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");
@y2q-actionman
y2q-actionman / TODO
Last active Mar 19, 2019
with-c-syntax backquote
View TODO
* #{ -> ` -> #{ をネストできるように
* flet や handler-case や with-open-file で遊ぶと nest の例できそう
* struct 対応
* vacietis に触れる
@y2q-actionman
y2q-actionman / with-repl-variables.lisp
Last active Jun 21, 2019
repl 変数使えば anaphora いらんやん
View with-repl-variables.lisp
(in-package :cl-user)
(defmacro with-repl-variables (&body body)
"BODY 中の式を、REPL 変数の `*', `+', `/', `-' 等を bind しながら順次実行する。"
(let ((form-results (gensym)))
`(let ((* *) (** **) (*** ***)
(+ +) (++ ++) (+++ +++) (- -)
(/ /) (// //) (/// ///))
,@(loop for form in body
collect
You can’t perform that action at this time.