On Feb 25, 6:21 pm, Ken Wesson <kwess...@gmail.com> wrote:
> On Fri, Feb 25, 2011 at 11:21 AM, Michael Wood <esiot...@gmail.com> wrote:
> > Would this help?
>
> > user=> (def exit "Use Ctrl-C to exit")
> > #'user/exit
> > user=> exit
> > "Use Ctrl-C to exit"
> > user=>
>
> Why stop there?
>
> (defn exit [] (System/exit 0))

But then the user has to know to type exit instead of (exit). Let's
give them the whole Python experience:

akm@sultan:~$ java -cp src/clojure/sexpbot/lib/clojure-1.2.0.jar
clojure.main
Clojure 1.2.0
user=> (def exit (repeatedly #(System/exit 0)))
#'user/exit
user=> exit
akm@sultan:~$

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to