examples/repl.nila in nilac-0.0.4.3.9.7 vs examples/repl.nila in nilac-0.0.4.3.9.7.1
- old
+ new
@@ -1,21 +1,28 @@
# This is a small REPL for Nila to test out nila code and do bug fixes
require 'readline'
+require 'fs'
+
+stream = fs.createWriteStream("my_file.nila")
+
+stream.once 'open', do |fd|
+
+ stream.write("Testing!\n")
+
+ stream.end()
+
+end
+
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!"
\ No newline at end of file