Sha256: a3473bd3d56409266051722fe2a3b431250894e52ab4fa0bdddd9a0ef1352175

Contents?: true

Size: 345 Bytes

Versions: 3

Compression:

Stored size: 345 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 Coolline.new.readline
        rescue Exception => e
          e.message
        end
      end
    end
  end
end

if __FILE__ == $0
   Lisp.repl
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lisp-1.3.0 lib/lisp/repl.rb
lisp-1.2.0 lib/lisp/repl.rb
lisp-1.1.0 lib/lisp/repl.rb