Skip to content

Instantly share code, notes, and snippets.

View moratori's full-sized avatar
😸

Katsuyoshi Ozaki moratori

😸
View GitHub Profile
@moratori
moratori / results.md
Last active November 21, 2021 15:11
Results of the Knuth-Bendix completion algorithm implemented in the tool Clover https://github.com/moratori/clover

Summary

title number
Completion Succeeded 65
Completion failed 6
Completion timeouted(over 30 seconds) 44
total 115

Detail

@moratori
moratori / sample-004-qlisp.lisp
Last active December 27, 2015 09:19
hp sample
(load "quicklisp.lisp")
(quicklisp-quickstart:install) ;; quicklispのインストール
(ql:add-to-init-file) ;; REPL起動時にQuicklispが読み込まれるように初期化ファイルに書き込む処理
(ql:system-apropos "match") ;; ライブラリを探してみる
(ql:quickload :cl-match) ;; ライブラリをロードしてみる
@moratori
moratori / sample-003-script
Created November 4, 2013 13:13
hp sample
$ clisp file.lisp
$ sbcl --script file.lisp
@moratori
moratori / lct.lisp
Created June 5, 2013 15:20
list comprehenison test
(print [x | x <- '(1 2 3)])
(print [(cons x y) | x <- '(1 2 3) y <- '(2 3) ])
(print [(funcall f x) | f <- '(sin cos tan) x <- '(1 2 3 4 5) (evenp x)])
(print [(* x y) | (x y) <- '((1 2) (3 4) (5 6))])
(ql:quickload :alexandria)
(use-package :alexandria)
@moratori
moratori / listi.lisp
Created June 5, 2013 15:18
list comprehension
(defun append-1 (val var) (append var (list val)))
(defmacro collect (constructor &rest def)
(let ((result (gensym))
(syms (loop for i from 1 upto (1- (length def)) collect (gensym))))
`(let ((,result nil))
(progn
,(labels
((main (constr def syms)
@moratori
moratori / simlpe-read-macro.lisp
Created June 5, 2013 15:02
simple read macro
;; Lisp のリーダは括弧の始まりを読むと閉じ括弧までを読む
;; ( から ) まで
;; 今それと同じ機能を [] にも 持たせる
;; まず閉じる目印になる括弧を設定
;; こいつは ) と同じ機能
(set-macro-character #\] (get-macro-character #\)))
;; 開き括弧に会ったら、閉じ括弧まで読む
(set-macro-character #\[
(lambda (stream char)
@moratori
moratori / sample-002-swank.vim
Last active December 18, 2015 01:19
setting for swank
"SBCLの例です
let g:slimv_python = '/usr/bin/python'
let g:slimv_swank_cmd = '! xterm -e sbcl --load /usr/share/common-lisp/source/slime/start-swank.lisp &'
$ sbcl
@moratori
moratori / sample-001-helloworld.lisp
Last active December 17, 2015 23:59
first program
(format t "hello, world~%")
@moratori
moratori / dagger.lisp
Created December 10, 2014 05:13
dagger
(set-macro-character #\DOUBLE_DAGGER
(get-macro-character #\) ))
(set-macro-character #\DAGGER
(lambda (stream char)
(declare (ignore char))
(read-delimited-list #\DOUBLE_DAGGER stream t)))
† defun fact † n‡