Sha256: 9aabf3822eb22ee65e92cf9bb0c13a18e7ad66d9837c22e6ff7614165ca8ee1c

Contents?: true

Size: 460 Bytes

Versions: 1

Compression:

Stored size: 460 Bytes

Contents

# This is a small REPL for Nila to test out nila code and do bug fixes

require 'readline'

rl = readline.createInterface(process.stdin, process.stdout)

rl.setPrompt('nila> ')

rl.prompt()

read = rl.on 'line', do |line|
  case line.trim()
    when 'hello'
      puts "world!"
    else
      puts "Say what? I might have heard #{line.trim()}"
  end
  rl.prompt()
end

read.on 'close', do
  puts "Have a great day!"
  process.exit(0)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nilac-0.0.4.3.9.7 examples/repl.nila