A readline library for MoonBit
moon add oboard/readlinefn main {
let rl = @readline.new()
rl.question("What is your name? ", name => {
println("Hello " + name)
rl.question("How old are you? ", age => {
println("You are " + age + " years old")
rl.close()
})
})
}let rl = @readline.new()rl.question("Enter your name: ", input => {
println("You entered: " + input)
})rl.close()| Platform | Implementation | Status |
|---|---|---|
| JavaScript | Browser/Node.js | โ Supported |
| Native | C with stdio | โ Supported |
| WebAssembly | WASM | โ Unsupported |
fn main {
let rl = @readline.new()
rl.question("What's your favorite color? ", color => {
println("Nice choice: " + color)
rl.close()
})
}fn main {
let rl = @readline.new()
rl.question("First name: ", first => {
rl.question("Last name: ", last => {
println("Full name: " + first + " " + last)
rl.close()
})
})
}A readline library for MoonBit