Thank you for your response, NiclasMattson!
I am entering the code line-by-line within the editor window in Atom after installing the “uber-juno” package.
You got me to thinking though, that it might be some interaction within Juno and/or Atom, so I did a File/Save As to the name “bub.jl”, then opened a new Teminal window and ran “Julia bub.jl”. The program behaved exactly as I would expect it to.
So I switched over to my Debian box, installed Atom and Uber-Juno, and again typed in the three bais lines of code (no copy/paste), and when I run the code (Command-Shift-Enter), it misbehaves exaactly as I reported it doing on my Mac in my first post. Here in Debian , I again did a File/Save As (different machine, different OS, same tools, same code), and it worked perfectly, as I would expect the code to work.
So it appears that there’s something about Atom/Juno that’s … buggy. My code is good, and functional. The Atom/Juno IDE is not.
Concerning your first side-note: I don’t understand the value of writing a several-line function, with its overhead, over just using the three lines inline:
function Input(prompt)
print(prompt)
readline()
end
n = Input("Enter your name: ")
println("Your name is $n.")
vs.
print("Enter your name: ")
n = readline()
println("Your name is $n.")
If I were to want to reuse this feature, sure, a function makes sense. But for a one-off use, it seems the function reduces both readability and efficiency. Perhaps I’m missing something?
Concerning your second side-note, thanks! I want to do things the right way (including converting my code to a function, if indeed that’s the right way), so I appreciate you making me aware of this code-quoting feature of this forum.
–
Kent