This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Q.1 | |
(defun hoge () (print "hoge")) | |
(compile 'hoge) | |
(print (compiled-function-p 'hoge)) | |
;;; Q.2 | |
(defun |@| (&rest rest) | |
(if (nth 3 rest) | |
(format (car rest) "~a~&" (cadr rest)))) | |
(format t "~{~@/@/~^~&~}" '(1 2 3 4)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .zshrc file for zsh(1) | |
## Completion configuration | |
autoload -U -U compinit | |
compinit | |
zstyle ':completion:*' list-colors 'di=34' 'ln=35' 'so=32' 'ex=31' 'bd=46;34' 'cd=43;34' | |
## Environment variable configuration | |
# LANG | |
export LANG=ja_JP.UTF-8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro def-print-string (name) | |
`(defun ,name () | |
(let ((one (count t'(t)))) | |
(coerce | |
(mapcar #'code-char | |
(list | |
,@(loop :for i :across (string name) | |
:collect | |
`(+ ,@(loop :for j := (char-code i) :then (floor j #.(count t'(t t))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(ql:quickload :clack) | |
(ql:quickload :clack-app-route) | |
(ql:quickload :cl-who) | |
(ql:quickload :parenscript) | |
(ql:quickload :chatai-tan)) | |
(defpackage :webspeech | |
(:use :cl | |
:cl-who |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro cut (&rest args) | |
(let ((func (cond ((eql '<> (car args)) (gensym)) | |
((symbolp (car args)) (list 'function (car args))) | |
(t (car args)))) | |
(gensyms (loop repeat (count '<> (cdr args)) | |
collect (gensym))) | |
(rest-arg (if (eql '<...> (car (last (cdr args)))) `(&rest ,(gensym))))) | |
(labels ((rec (args-list gensyms-list result) | |
(cond ((null args-list) (reverse result)) | |
((eql '<> (car args-list)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax swap! | |
(sc-macro-transformer | |
(lambda (form env) | |
(let ((a (make-syntactic-closure env '() (cadr form))) | |
(b (make-syntactic-closure env '() (caddr form)))) | |
`(let ((value ,a)) | |
(set! ,a ,b) | |
(set! ,b value)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax swap! | |
(rsc-macro-transformer | |
(lambda (form env) | |
(let ((a (cadr form)) | |
(b (caddr form)) | |
(value (make-syntactic-closure env '() 'value)) | |
(let-r (make-syntactic-closure env '() 'let)) | |
(set!-r (make-syntactic-closure env '() 'set!))) | |
`(,let-r ((,value ,a)) | |
(,set!-r ,a ,b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax swap! | |
(er-macro-transformer | |
(lambda (form rename compare?) | |
(let ((a (cadr form)) | |
(b (caddr form))) | |
`(,(rename 'let) ((,(rename 'value) ,a)) | |
(,(rename 'set!) ,a ,b) | |
(,(rename 'set!) ,b ,(rename 'value))))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax swap! | |
(ir-macro-transformer | |
(lambda (form inject compare?) | |
(let ((a (cadr form)) | |
(b (caddr form))) | |
`(let ((tmp ,a)) | |
(set! ,a ,b) | |
(set! ,b tmp)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax aif | |
(ir-macro-transformer | |
(lambda (form inject compare?) | |
(let ((it (inject 'it)) | |
(test (cadr form)) | |
(then (caddr form)) | |
(else (cadddr form))) | |
`(let ((,it ,test)) | |
(if ,it ,then ,else)))))) |
OlderNewer