Re: easier exit

2011-03-03 Thread rogerdpack

> > Also is there any way to contribute patches to the clojure website
> > itself? (maybe put it up on github too?)
>
> Instructions on the patch process are 
> athttp://dev.clojure.org/display/design/JIRA+workflow.  Issues waiting for 
> patches are 
> athttp://dev.clojure.org/jira/secure/IssueNavigator.jspa?mode=hide&requ

I was referring to patches against the text of http://clojure.org/
itself is that patchable somewhere?
Cheers!
-r

-- 
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


Re: easier exit

2011-03-03 Thread rogerdpack


On Feb 25, 9:43 am, Stuart Halloway  wrote:
> > Hello all. A bit new to clojure here.  Anyway I found it a bit
> > difficult to exit from a REPL.
> > Would a patch to make it give instructions (like Python's
>
> > C:\>c:\installs\Python26\python.exe
>  exit
> > Use exit() or Ctrl-Z plus Return to exit
>
> > )
>
> > like that have a chance to be accepted?
>
> Hi Roger,
>
> Thanks for asking--it is always good to start on the mailing list before 
> going to the trouble of making a patch. A REPL exit patch would not be 
> accepted, for the following reasons:
>
> (1) The problem, and its solution, are far from clear and compelling. 
> Python's approach to this is not universally hailed as a good one.

I believe the "problem" in this case is that typically, one types exit
to exit a shell (bash, ruby, python [warns you that this doesn't
work]). This is quite convenient for newcomers (and no other shell
that I'm aware of, in windows, requires a ctrl+d or ctrl+z to exit).
Cheers!
-r

-- 
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


Re: easier exit

2011-02-26 Thread .Bill Smith
Yeah, you're right.  I was thinking of what happens when you fall off the 
end of main.

-- 
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

Re: easier exit

2011-02-25 Thread Ken Wesson
On Fri, Feb 25, 2011 at 10:04 PM, .Bill Smith  wrote:
> If you are running any non-daemon threads, even System.exit won't cause the
> JVM to shut down.

I'm pretty sure it will. Falling off the end of main won't and closing
all GUI windows won't, but System/exit is supposed to kill the VM
reliably.

In particular, when I did this:

user=> (def q (agent []))
#'user/q
user=> (send q conj 3)
#
user=> (System/exit 0)
Repl is disconnected

and Task Manager showed the Java process disappearing completely, even
though (for some odd reason) agent threads are non-daemon (which is
why the JVM will linger after a GUI closes if you don't call
shutdown-agents after using agents).

-- 
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


Re: easier exit

2011-02-25 Thread Ken Wesson
On Fri, Feb 25, 2011 at 9:39 PM, Alan  wrote:
> On Feb 25, 6:21 pm, Ken Wesson  wrote:
>> On Fri, Feb 25, 2011 at 11:21 AM, Michael Wood  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:~$

I figured anyone using a Lisp REPL knows to wrap "command" like things
in parentheses. And would feel that an expression like "exit" without
parentheses having side effects would be pretty icky. :)

-- 
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


Re: easier exit

2011-02-25 Thread .Bill Smith
If you are running any non-daemon threads, even System.exit won't cause the 
JVM to shut down.  Whereas as Michael Wood pointed out, there are various 
control sequences that do the trick reliably.

-- 
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

Re: easier exit

2011-02-25 Thread Alan
On Feb 25, 6:21 pm, Ken Wesson  wrote:
> On Fri, Feb 25, 2011 at 11:21 AM, Michael Wood  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


Re: easier exit

2011-02-25 Thread Ken Wesson
On Fri, Feb 25, 2011 at 11:21 AM, Michael Wood  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))

-- 
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


Re: easier exit

2011-02-25 Thread Stuart Halloway
> Hello all. A bit new to clojure here.  Anyway I found it a bit
> difficult to exit from a REPL.
> Would a patch to make it give instructions (like Python's
> 
> C:\>c:\installs\Python26\python.exe
 exit
> Use exit() or Ctrl-Z plus Return to exit
 
> 
> )
> 
> like that have a chance to be accepted?

Hi Roger,

Thanks for asking--it is always good to start on the mailing list before going 
to the trouble of making a patch. A REPL exit patch would not be accepted, for 
the following reasons:

(1) The problem, and its solution, are far from clear and compelling. Python's 
approach to this is not universally hailed as a good one. 

(2) Language features sit at the bottom of the world, and gain momentum if they 
solve problems nobody else can solve at a higher level. REPL interaction 
niceties can be solved at a higher level, and the fact that different people do 
it different ways is good anecdotal evidence that there need not be a 
one-size-fits-all solution in the language.

(3) The default response for good new features is, and has to be, "No, thanks." 
 Clojure would triple in size otherwise.

> Also is there any way to contribute patches to the clojure website
> itself? (maybe put it up on github too?)

Instructions on the patch process are at 
http://dev.clojure.org/display/design/JIRA+workflow.  Issues waiting for 
patches are at 
http://dev.clojure.org/jira/secure/IssueNavigator.jspa?mode=hide&requestId=1.

Cheers,
Stu

Stuart Halloway
Clojure/core
http://clojure.com

-- 
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

Re: easier exit

2011-02-25 Thread Michael Wood
On 25 February 2011 17:35, Armando Blancas  wrote:
> Using jline you can exit with ctrl-d. This is from the clojure web
> site in Getting Started:
>
> The REPL has very rudimentary editing. For a better experience, try
> running it via the JLine ConsoleRunner:
> java -cp jline-0_9_5.jar:clojure.jar jline.ConsoleRunner clojure.main

Ctrl-D works with the plain REPL too.  No need for jline for that.
(Or Ctrl-Z on Windows.)  Ctrl-C also works.

> On Feb 24, 4:38 pm, rogerdpack  wrote:
>> Hello all. A bit new to clojure here.  Anyway I found it a bit
>> difficult to exit from a REPL.
>> Would a patch to make it give instructions (like Python's
>>
>> C:\>c:\installs\Python26\python.exe>>> exit
>>
>> Use exit() or Ctrl-Z plus Return to exit

Would this help?

user=> (def exit "Use Ctrl-C to exit")
#'user/exit
user=> exit
"Use Ctrl-C to exit"
user=>

Not sure how likely it would be for someone to add that to Clojure, though :)

-- 
Michael Wood 

-- 
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


Re: easier exit

2011-02-25 Thread Armando Blancas
Using jline you can exit with ctrl-d. This is from the clojure web
site in Getting Started:

The REPL has very rudimentary editing. For a better experience, try
running it via the JLine ConsoleRunner:
java -cp jline-0_9_5.jar:clojure.jar jline.ConsoleRunner clojure.main

On Feb 24, 4:38 pm, rogerdpack  wrote:
> Hello all. A bit new to clojure here.  Anyway I found it a bit
> difficult to exit from a REPL.
> Would a patch to make it give instructions (like Python's
>
> C:\>c:\installs\Python26\python.exe>>> exit
>
> Use exit() or Ctrl-Z plus Return to exit
>
>
>
> )
>
> like that have a chance to be accepted?
>
> Also is there any way to contribute patches to the clojure website
> itself? (maybe put it up on github too?)
> Cheers!
> -r

-- 
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


easier exit

2011-02-24 Thread rogerdpack
Hello all. A bit new to clojure here.  Anyway I found it a bit
difficult to exit from a REPL.
Would a patch to make it give instructions (like Python's

C:\>c:\installs\Python26\python.exe
>>> exit
Use exit() or Ctrl-Z plus Return to exit
>>>

)

like that have a chance to be accepted?

Also is there any way to contribute patches to the clojure website
itself? (maybe put it up on github too?)
Cheers!
-r

-- 
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