Skip to content

Instantly share code, notes, and snippets.

@stibear
Last active December 17, 2015 18:29
Show Gist options
  • Save stibear/5653118 to your computer and use it in GitHub Desktop.
Save stibear/5653118 to your computer and use it in GitHub Desktop.
Common Lisp 理解度チェーック 各出力を頭で考えた後に実行して答え合わせしてみてね! 参考:https://gist.github.com/anonymous/5652948
;;; 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))
;;; Q.3
(defvar value 100)
(defun print-value ()
(print value))
(progn (print-value)
(let (value)
(print-value)))
;;; Q.4
(print (let ((let '`(let ((let ',let))
,let)))
`(let ((let ',let)) ,let)))
;;; Q.5
(defmacro for ((var start stop) &body body)
`(do ((,var ,start (1+ ,var))
(limit ,stop))
((> ,var limit))
,@body))
(let ((limit 0))
(for (x 1 10)
(print limit)))
@stibear
Copy link
Author

stibear commented May 26, 2013

ネタ尽きた

@stibear
Copy link
Author

stibear commented May 27, 2013

この「test.lisp」を書いている人は力尽きてしまいました。 あとは適当に頑張ってください。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment