philipbohun.com

Glojure by Example: Hello World

The first program prints a line of text. Glojure source that uses Go interop conventionally lives in a .glj file. This one is plain Clojure, which glj runs just as well.

(println "hello world")

Put the code in hello-world.glj and run it with glj.

$ glj hello-world.glj
hello world

glj -e evaluates an expression without saving a file. With no arguments, glj starts a REPL.

$ glj -e '(println "hello world")'
hello world

Next example: Values.