なんだこれは

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

たとえばこんな ros スクリプト

こうなります。

すごい。。初めに気づいた人しゅごい。。なんの役に立つのかあれだけど。。

http://john-bardera.hatenablog.com/entry/2017/01/28/220631

の返信になります。

まず、roswell いれるじゃろ(MIT License)

debianならaptできる?

  • libcurl のヘッダ
  • libcurl
  • automake がいるらしい
git clone -b release https://github.com/roswell/roswell.git
cd roswell
sh bootstrap
./configure
make
sudo make install

とりあえず初期化するじゃろ

ros install

それで、欲しい処理系選ぶじゃろ

ros install sbcl

それから スクリプトのテンプレート作成するじゃろ

ros init fact

Successfully generated: fact.ros

じゃあ、fact.rosを開くじゃろ

#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"

#

(progn ;;init forms
(ros:ensure-asdf)
;;#+quicklisp (ql:quickload '() :silent t)
)

(defpackage :ros.script.test.3696462577
(:use :cl))
(in-package :ros.script.test.3696462577)

(defun main (&rest argv)
(declare (ignorable argv)))
;;; vim: set ft=lisp lisp:

3行目までは sh で解釈すると、コメントで、4行目でexec があるからその後ろはshellで解釈されないじゃろ

それから、ros (つまりCommon Lisp)は 一行めはshebangだから読み飛ばし、
#| |# は Common Lispのコメントだから読み飛ばしじゃろ、
そのあとはちゃんとした Common Lispのソースじゃろ。

すごい。。初めに気づいた人しゅごい。。なんの役に立つのかあれだけど。。

つまり、shからスムーズに Common Lisp 便利じゃろ