"John D. Hume" <[email protected]> writes:
> I'd suggest that Clojure's "Hello, World!" should happen initially at the
> repl, where leiningen definitely simplifies the UX.
>
> lein repl # from any cwd
> (println "...")
>
> which launches nicely into demonstrating dynamic development.
Except that the Clojure repl is not persistant; compare this to R for instance:
$ lein repl
user=> (defn fun[]
#_=> (println "hello"))
#'user/fun
user=> (fun)
hello
nil
user=> Bye for now!
$ lein repl
user=> (fun)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: fun in
this context, compiling:(NO_SOURCE_PATH:1:1)
$ R
> hello <- function(){
+ print("Hello")
+ }
> hello
function(){
print("Hello")
}
> hello()
[1] "Hello"
>
Save workspace image? [y/n/c]: y
$ R
[Previously saved workspace restored]
> hello()
[1] "Hello"
>
With R, the REPL is a user-interface that you can work in over time.
With Clojure, the REPL is somewhere you can experiment, but ultimately
you have to keep your source in a file.
I've tried teaching python using it's repl and you have the same problem
there. It's fine for teaching what print "hello" does, and what 7/2
returns. After that, you have to say "now forget that REPL stuff and
let's type a file".
Phil
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.