Readline interface: Difference between revisions
Content added Content deleted
Line 116: | Line 116: | ||
- readline_interface.hello |
- readline_interface.hello |
||
>exit</pre> |
>exit</pre> |
||
=={{header|Julia}}== |
|||
{{works with|Julia|0.6}} |
|||
Simple program that does nothing (copy of [[#C C]]. |
|||
<lang julia>function input(prompt::AbstractString) |
|||
print(prompt) |
|||
r = readline(STDIN) |
|||
if isempty(r) || r == "quit" |
|||
println("bye.") |
|||
elseif r == "help" |
|||
println("commands: ls, cat, quit") |
|||
elseif r ∈ ("ls", "cat") |
|||
println("command `$r` not implemented yet") |
|||
else |
|||
println("Yes...?") |
|||
end |
|||
end |
|||
input("This is a common prompt> ")</lang> |
|||
=={{header|Kotlin}}== |
=={{header|Kotlin}}== |