慶應義塾大学SFCの2001年春学期の「記号処理プログラミング」(担当:安村 通晃)の課題(ミニプロ)として、Rubyで実装したScheme風の簡易的なLisp処理系です。 Scheme風を目指していますが、仕様はかなり簡略化したものです。 (その後、Ruby 3.x で対応と Web 版の実装などを行なっています)
This is a simple Scheme-like Lisp implementation written in Ruby, created as a mini-project for the “Symbolic Processing Programming” course (instructor: Michiaki Yasumura) at Keio University SFC during the Spring 2001 semester. While aiming for Scheme-like functionality, the specification is significantly simplified. (Subsequently, updates for Ruby 3.x compatibility and a web-based implementation were developed.)
🚀 Try on your browser: WebAssembly Demo (no installation required!)
- Ruby >=2.5
bundle install
bundle exec rouge.rb実行例:
rouge> (define fact
rouge* (lambda (x)
rouge* (if (<= x 0)
rouge* 1
rouge* (* x (fact (- x 1))))))
rouge> (fact 10)
3628800
rouge> (bye)
REPL の終了は (bye) で行います。
bundle install
bundle exec rake testRuboCop を使ってコードスタイルをチェックできます。
bundle exec rake rubocop # lint を実行
bundle exec rake rubocop:autocorrect # 自動修正可能な違反を修正既存コードの違反は .rubocop_todo.yml に記録されています。
新しく書くコードは RuboCop のルールに従ってください。
- 完全数/不完全数の概念をサポートしない
- 入出力周り
- 複素数リテラル
- マクロ
- マルチバイト文字
- (他にも沢山)
Copyright (C) 2001-2026 Masahiro Sakai
Unless otherwise noted, all files in this repository are dual-licensed under:
- the BSD 2-Clause License (see LICENSE.BSD), or
- the Ruby License (see LICENSE.Ruby)
Exceptions:
rouge/parser.rbThis file is derived from third-party software originally licensed under the GNU General Public License (GPL) or the Ruby License. Therefore it is distributed under the GPL or the Ruby License.
