by dragandj · 7y ago · 0 comments
Now that you've gotten everything setup, let's write a program! Open up your favorite text editor and type in the following:
puts 1+2 Save your program (yes, that's a program!) as calc.rb (the .rb is what we usually put at the end of programs written in Ruby). Now run your program by typing ruby calc.rb into your command line. It should have put a 3 on your screen. See, programming isn't so hard, now is it?
It's this sort of thing that probably drives the likes of Alan Kay crazy when even learning a language isn't interactive by default.
(println (+ 1 2))
Then clojure calc.clj