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 / applytest.lisp
Last active September 5, 2018 04:00
apply のために vector を dynamic-extent なバッファに展開してようとしたけど、全然はやくなかった (Allegro CL)
#|
http://www.project-enigma.jp/2018-09-03-01.htm
|#
(in-package :cl-user)
(defun make-tuple (&rest args)
(apply #'vector args))
(declaim (ftype (function (&rest t) simple-vector)
make-tuple))
@y2q-actionman
y2q-actionman / a_road_to_common_lisp_jp.md
Last active April 30, 2024 17:55
A Road to Common Lisp 翻訳

この文章は、 Steve Losh 氏の記事 "A Road to Common Lisp" の翻訳です。

原文はこちらです: http://stevelosh.com/blog/2018/08/a-road-to-common-lisp/


A Road to Common Lisp (Common Lisp への道)

これまで、「最近のCommon Lispをどう学ぶとよいでしょう?」と助言を求めるメールをたくさん受け取ってきました。そこで私は、これまでメールやソーシャルメディアに投稿した全てのアドバイスを書き下すことにしました。これが誰かに有益ならば幸いです。

@y2q-actionman
y2q-actionman / with-hq9+.lisp
Last active April 11, 2021 14:53
with-hq9+
(in-package :cl-user)
(defpackage :HQ9+
(:use #:cl)
(:shadow #:+) ; for avoiding package lock!!
(:export
#:HQ9+
#:with-HQ9+))
(in-package :HQ9+)
@y2q-actionman
y2q-actionman / 3.6.1 status hilite
Last active July 23, 2018 03:43
jnethack 3.6.0 0.8 compile
https://nethackwiki.com/wiki/Status_hilites
https://osdn.net/projects/jnethack/news/25783
# iconv
https://qiita.com/tatsumack/items/9f1ae8dee4dbb33b7406
--- nethack-3.6.1/circle.yml 1970-01-01 09:00:00.000000000 +0900
+++ jnethack/source/circle.yml 2016-02-14 04:06:09.061085100 +0900
@@ -0,0 +1,10 @@
+dependencies:
@y2q-actionman
y2q-actionman / test.lisp
Created July 12, 2018 05:54
Common Lisp で :key パラメータをとる関数。 cons 系と sequence 系しかなさそう。
CL-USER> (loop for sym being the external-symbol in (find-package :cl)
when (fboundp sym)
do (let ((arglist (excl:arglist sym)))
(when (and (member '&key arglist)
(member 'key arglist
:test (lambda (x y)
(ignore-errors (string= x y)))))
(format t "~&~A -> ~A~%" sym arglist))))
NSUBST -> (NEW OLD TREE &KEY KEY TEST TEST-NOT)
MEMBER-IF -> (PREDICATE LIST &KEY KEY)
@y2q-actionman
y2q-actionman / defconst_eval_test.lisp
Created July 10, 2018 15:21
defconstant と read-eval
(in-package :cl-user)
(eval-when (:load-toplevel)
(princ "defining")
(defconstant +hoge+ 100)
(princ "defined"))
(defvar *hoge*
(+ #.+hoge+ ; error
+hoge+))
@y2q-actionman
y2q-actionman / clhs3.1.2.1.1.4
Created July 10, 2018 08:43
clhs 3.1.2.1.1.4 は defvar された変数だと違う
http://www.lispworks.com/documentation/HyperSpec/Body/03_abaad.htm
CL-USER> (describe 'x)
X is a TENURED SYMBOL.
It is unbound.
It is globally declared to be a special variable.
It is INTERNAL in the COMMON-LISP-USER package.
; No value
CL-USER> (describe 'y)
Y is a NEW SYMBOL.
@y2q-actionman
y2q-actionman / nethacktemp.txt
Created July 1, 2018 17:51
Nethack メモ テンプレート 1

;; -*- mode: org; -*-

Dungeon

1.

  1. (fountain)
  2. (vault), fountain, (sink), (sink)
  3. MINE, fountain
  4. shop(tool), alter, magic_trap ## stash
  5. shop(armor), (vault?)
@y2q-actionman
y2q-actionman / ff5_2018-05-22.org
Last active June 18, 2018 18:02
FF5 プレイ日記

初日 (3:45)

オープニング - 風の神殿

  • 最初、右下の宝箱を忘れない
  • 風の神殿に直行しても何も問題ない
  • 「ウイングラプター」は雑魚。準備しないで倒せた。
  • ウイングラプターの次の階、右下の「つえ」を忘れない。
@y2q-actionman
y2q-actionman / bf.c
Created May 22, 2018 06:06
brainfuck simple impl in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static char* instruction = NULL;
static size_t instruction_size = 0;
#define DEFAULT_DATA_SIZE 30000
static char data[DEFAULT_DATA_SIZE];