なんだこれは

はてなダイアリーから移転しました。

hackerrankについて

hackerRank (https://www.hackerrank.com/) というプログラマの遊び場があってCommon Lispも遊べるという謳い文句があった気がした。

ところがチュートリアルの 30 Days of Codeのいくつかの課題は lisp での回答を受け付けないようになっている。

しかたがないと perl で回答を進めていくと、perlもダメな課題がある。

なんだかがっかりである。

Kahua 1

Kahua のインストールめも

vagrant

mkdir somewhere
cd somewhere
vagrant init ubuntu/xenial64
vagrant up
vagrant ssh

xenial64

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install gauche gauche-gdbm gauche-dev gauche-doc

xenial64 の Vagrant imageにバグがあるので、
/etc/hosts に次の行を追加しなければならない

127.0.1.1 ubuntu-xenial
https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1561250

あとでコマンドに変更しなければならない。

kahua

sudo apt-get install build-essential
git clone https://github.com/kahua/Kahua.git
cd Kahua

configure がないので、./DIST gen を実行したら、

./DIST: 1: ./DIST: gauche-config: not found
autoconf: error: option `-I' requires an argument
Try `autoconf --help' for more information.
./DIST: 1: ./DIST: gauche-config: not found
autoconf: error: option `-I' requires an argument
Try `autoconf --help' for more information.

といわれる。

automake
autoconfいれて、
texinfo いれる

ccl で 1からNまで足してみた

exercism.io というプログラムの学習サイトで課題をこなしている。
そこであったlispの課題で、1からNまで足して二乗するという計算があった。
もちろん、数学の公式をつかえばいいのはわかっているんだけれども、これ以外の方法で試してみた。

(defun square (x)
  (* x x))

(defun square-of-sums (x)
  (square (/ (* x (1+ x)) 2)))
続きを読む

Command Line Tools 10.11 がでていたので CCL 1.10 の再インストールvia Macports

Command Line Tools 10.11 for Xcode 7.1 beta 3 がかなり前にリリースされていた模様。せっかくなのでインストールしなおしした。さらに ccl 1.10 をビルドしてみた。

ちなみに、インストール済みの Command Line Tools のバージョンは pkgutil で調べられるらしい。

続きを読む