Sha256: d543b2ccb4035a624b3635ddfe7163abba1eabd97a17ff028b971d34ae4056c8

Contents?: true

Size: 379 Bytes

Versions: 5

Compression:

Stored size: 379 Bytes

Contents

#!/usr/bin/env ruby
require "coolline"

module Lisp
  def self.repl
    trap("SIGINT") { throw :exit }
    puts "ctrl-c to exit"
    catch(:exit) do
      loop do
        puts begin
          eval input.readline
        rescue Exception => e
          e.message
        end
      end
    end
  end

  def self.input
    Coolline.new
  end
end

if __FILE__ == $0
   Lisp.repl
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lisp-1.0.6 lib/lisp/repl.rb
lisp-1.0.5 lib/lisp/repl.rb
lisp-1.0.4 lib/lisp/repl.rb
lisp-1.0.3 lib/lisp/repl.rb
lisp-1.0.2 lib/lisp/repl.rb