- Book "実践 Common Lisp"
- 第1章 序論:なぜLispなのか?
- 第2章 お気の済むまで:REPLツアー
- 第3章 実践:簡単なデータベース
- 第4章 シンタックスとセマンティクス
- 第5章 関数
- 第6章 変数
- 第7章 マクロ:標準的な制御構文の構築
- 第8章 マクロ:自分で定義しよう
ネットワーク機器のコンソールアクセス等,シリアル通信が必要となる. 最近のPCではシリアル端子は省かれてしまっているのでUSBシリアル変換ケーブルを利用. 多くの製品はmacを公式にサポートしていないが,チップメーカーにてドライバが提供されているので, その利用環境を整えるためのメモ.
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
;;; Project Euler #8 | |
;;; http://projecteuler.net/problem=8 | |
;;; http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%208 | |
(use 'clojure.test) | |
(def input | |
(str | |
"73167176531330624919225119674426574742355349194934" | |
"96983520312774506326239578318016984801869478851843" |
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
;;; Project Euler Problem 1 | |
;;; http://odz.sakura.ne.jp/projecteuler/index.php?cmd=read&page=Problem%201 | |
;;; | |
;;; 10未満の自然数のうち、3 もしくは 5 の倍数になっているものは 3, 5, 6, 9 の4つがあり、 これらの合計は 23 になる。 | |
;;; 同じようにして、1,000 未満の 3 か 5 の倍数になっている数字の合計を求めよ。 | |
;;; 3 もしくは 5の倍数の場合 true、そうでない場合 false を返す filter 判定用関数 | |
(defn fizz-or-buzz? | |
"3か5で割り切れるならtrue、そうでないならfalseを返す。" | |
[n] |