Re: Terminating 'clj' REPL session

2017-12-11 Thread Oleksandr Shulgin
On Sat, Dec 9, 2017 at 11:37 PM, Alan Thompson  wrote:

> Hi - Just downloaded the new Clojure 1.9.0 package.  When I tried the repl
> I noticed that it doesn't respond to either `exit` or `quit` as one might
> expect from the lein repl:
>
> ~/cool/tools > clj
> Clojure 1.9.0
> user=> (+ 2 3)
> 5
> user=> exit
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> exit in this context, compiling:(NO_SOURCE_PATH:0:0)
> user=>
> user=> quit
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> quit in this context, compiling:(NO_SOURCE_PATH:0:0)
> user=> ^D
> ~/cool/tools >
>
>
> Lein repl for comparison:
>
> ~/tupelo > lein repl
> nREPL server started on port 37115 on host 127.0.0.1 - Clojure 1.9.0
> tupelo.core=> exit
> Bye for now!
>
> ~/tupelo >
>
> ~/tupelo > lein repl
> nREPL server started on port 40639 on host 127.0.0.1 - Clojure 1.9.0
> tupelo.core=> quit
> Bye for now!
> ~/tupelo >
>
>
> The new repl does terminate upon CRTL-D or CRTL-C, but many users will
> probably be confused that `quit` and `exit` are not accepted.
>

To recap, my lein repl starts with the following help banner:

Docs: (doc function-name-here)
  (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

That doesn't suggest that `exit` alone without the function call is going
stop the main loop.

The problems begin when one tries to use it in the middle of an unfinished
s-expr, a primary reason could be that the user doesn't understand the
changed prompt:

user=> (+ 1
  #_=> exit
  #_=> )

CompilerException java.lang.RuntimeException: Unable to resolve symbol:
exit in this context, compiling:(/tmp/form-init4088985676787273132.clj:1:1)

Actually, a more likely scenario is like this:

user=> (+ 1
  #_=> exit
  #_=> quit
  #_=> help
  #_=> why are you doing this to me?

Nor does (exit) call works, which is contrary to the help doc:

user=> (+ 1
  #_=> (exit))

CompilerException java.lang.RuntimeException: Unable to resolve symbol:
exit in this context, compiling:(/tmp/form-init4248691177104478700.clj:2:1)

An interesting thing is the same issue is discussed currently on the
PostgreSQL mailing list about behavior of psql:


https://www.postgresql.org/message-id/flat/94e59791-e788-4ebb-80a9-9c871ff5df64%40manitou-mail.org

In particular, the following suggestion seems to provide a reasonable way
out of this problem:


https://www.postgresql.org/message-id/flat/94e59791-e788-4ebb-80a9-9c871ff5df64%40manitou-mail.org#1735.1512761160%40sss.pgh.pa.us

Not sure if this can be done with Clojure, short of employing reader macros
in some way?

Cheers,
--
Alex

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminating 'clj' REPL session

2017-12-10 Thread Alex Miller
Sure, file a ticket.

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminating 'clj' REPL session

2017-12-09 Thread Alan Thompson
I just noticed that Python will give you hints (but only after guessing
wrong):

~ > python
Python 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> quit
Use quit() or Ctrl-D (i.e. EOF) to exit
>>>





On Sat, Dec 9, 2017 at 8:29 PM, Alan Thompson <clooj...@gmail.com> wrote:

> Would a message such as "use CRTL-D to exit" be appropriate?  Right now it
> is very bare.  Maybe this?
>
> ~ > clj
> Clojure 1.9.0 (use ^D to exit)
> user=>
> ~ >
>
> Alan
>
> On Sat, Dec 9, 2017 at 5:15 PM, Sean Corfield <s...@corfield.org> wrote:
>
>> I find the fact that "exit" and "quit" work in leiningen repls to be weird
>>
>>
>>
>> I agree. I’ve always used ctl-d to exit a Leiningen REPL or a Boot REPL –
>> or pretty much any console program I’ve ever used. I’m only surprised when
>> ctl-d _*doesn’t*_ work in such a program!
>>
>>
>>
>> And, after all, both Leiningen and Boot give ctl-d as the first option
>> for exiting a REPL:
>>
>>
>>
>> Exit: Control+D …
>>
>>
>>
>> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>>
>> "If you're not annoying somebody, you're not really alive."
>> -- Margaret Atwood
>>
>>
>> --
>> *From:* clojure@googlegroups.com <clojure@googlegroups.com> on behalf of
>> Justin Smith <noisesm...@gmail.com>
>> *Sent:* Saturday, December 9, 2017 2:55:17 PM
>> *To:* clojure@googlegroups.com
>> *Subject:* Re: Terminating 'clj' REPL session
>>
>> I find the fact that "exit" and "quit" work in leiningen repls to be
>> weird - this doesn't follow the otherwise consistent rules of the language.
>> What about an exit function, something like
>>
>> (defn exit
>>   ([] (exit 0))
>>   ([n] (System/exit n))
>>
>> so that it's not an out of band special case input?
>>
>> On Sat, Dec 9, 2017 at 2:38 PM Alan Thompson <clooj...@gmail.com> wrote:
>>
>>> Hi - Just downloaded the new Clojure 1.9.0 package.  When I tried the
>>> repl I noticed that it doesn't respond to either `exit` or `quit` as one
>>> might expect from the lein repl:
>>>
>>> ~/cool/tools > clj
>>> Clojure 1.9.0
>>> user=> (+ 2 3)
>>> 5
>>> user=> exit
>>> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
>>> exit in this context, compiling:(NO_SOURCE_PATH:0:0)
>>> user=>
>>> user=> quit
>>> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
>>> quit in this context, compiling:(NO_SOURCE_PATH:0:0)
>>> user=> ^D
>>> ~/cool/tools >
>>>
>>>
>>> Lein repl for comparison:
>>>
>>> ~/tupelo > lein repl
>>> nREPL server started on port 37115 on host 127.0.0.1 - Clojure 1.9.0
>>> tupelo.core=> exit
>>> Bye for now!
>>>
>>> ~/tupelo >
>>>
>>> ~/tupelo > lein repl
>>> nREPL server started on port 40639 on host 127.0.0.1 - Clojure 1.9.0
>>> tupelo.core=> quit
>>> Bye for now!
>>> ~/tupelo >
>>>
>>>
>>> The new repl does terminate upon CRTL-D or CRTL-C, but many users will
>>> probably be confused that `quit` and `exit` are not accepted.
>>>
>>> Should I file a JIRA?
>>>
>>> Alan
>>>
>>> --
>>> 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
>>> ---
>>> 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 clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>

Re: Terminating 'clj' REPL session

2017-12-09 Thread Alan Thompson
Would a message such as "use CRTL-D to exit" be appropriate?  Right now it
is very bare.  Maybe this?

~ > clj
Clojure 1.9.0 (use ^D to exit)
user=>
~ >

Alan

On Sat, Dec 9, 2017 at 5:15 PM, Sean Corfield <s...@corfield.org> wrote:

> I find the fact that "exit" and "quit" work in leiningen repls to be weird
>
>
>
> I agree. I’ve always used ctl-d to exit a Leiningen REPL or a Boot REPL –
> or pretty much any console program I’ve ever used. I’m only surprised when
> ctl-d _*doesn’t*_ work in such a program!
>
>
>
> And, after all, both Leiningen and Boot give ctl-d as the first option for
> exiting a REPL:
>
>
>
> Exit: Control+D …
>
>
>
> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>
> --
> *From:* clojure@googlegroups.com <clojure@googlegroups.com> on behalf of
> Justin Smith <noisesm...@gmail.com>
> *Sent:* Saturday, December 9, 2017 2:55:17 PM
> *To:* clojure@googlegroups.com
> *Subject:* Re: Terminating 'clj' REPL session
>
> I find the fact that "exit" and "quit" work in leiningen repls to be weird
> - this doesn't follow the otherwise consistent rules of the language. What
> about an exit function, something like
>
> (defn exit
>   ([] (exit 0))
>   ([n] (System/exit n))
>
> so that it's not an out of band special case input?
>
> On Sat, Dec 9, 2017 at 2:38 PM Alan Thompson <clooj...@gmail.com> wrote:
>
>> Hi - Just downloaded the new Clojure 1.9.0 package.  When I tried the
>> repl I noticed that it doesn't respond to either `exit` or `quit` as one
>> might expect from the lein repl:
>>
>> ~/cool/tools > clj
>> Clojure 1.9.0
>> user=> (+ 2 3)
>> 5
>> user=> exit
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
>> exit in this context, compiling:(NO_SOURCE_PATH:0:0)
>> user=>
>> user=> quit
>> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
>> quit in this context, compiling:(NO_SOURCE_PATH:0:0)
>> user=> ^D
>> ~/cool/tools >
>>
>>
>> Lein repl for comparison:
>>
>> ~/tupelo > lein repl
>> nREPL server started on port 37115 on host 127.0.0.1 - Clojure 1.9.0
>> tupelo.core=> exit
>> Bye for now!
>>
>> ~/tupelo >
>>
>> ~/tupelo > lein repl
>> nREPL server started on port 40639 on host 127.0.0.1 - Clojure 1.9.0
>> tupelo.core=> quit
>> Bye for now!
>> ~/tupelo >
>>
>>
>> The new repl does terminate upon CRTL-D or CRTL-C, but many users will
>> probably be confused that `quit` and `exit` are not accepted.
>>
>> Should I file a JIRA?
>>
>> Alan
>>
>> --
>> 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
>> ---
>> 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 clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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
> ---
> 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 clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 tha

RE: Terminating 'clj' REPL session

2017-12-09 Thread Sean Corfield
I find the fact that "exit" and "quit" work in leiningen repls to be weird

I agree. I’ve always used ctl-d to exit a Leiningen REPL or a Boot REPL – or 
pretty much any console program I’ve ever used. I’m only surprised when ctl-d 
_doesn’t_ work in such a program!

And, after all, both Leiningen and Boot give ctl-d as the first option for 
exiting a REPL:

Exit: Control+D …

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


From: clojure@googlegroups.com <clojure@googlegroups.com> on behalf of Justin 
Smith <noisesm...@gmail.com>
Sent: Saturday, December 9, 2017 2:55:17 PM
To: clojure@googlegroups.com
Subject: Re: Terminating 'clj' REPL session

I find the fact that "exit" and "quit" work in leiningen repls to be weird - 
this doesn't follow the otherwise consistent rules of the language. What about 
an exit function, something like

(defn exit
  ([] (exit 0))
  ([n] (System/exit n))

so that it's not an out of band special case input?

On Sat, Dec 9, 2017 at 2:38 PM Alan Thompson 
<clooj...@gmail.com<mailto:clooj...@gmail.com>> wrote:
Hi - Just downloaded the new Clojure 1.9.0 package.  When I tried the repl I 
noticed that it doesn't respond to either `exit` or `quit` as one might expect 
from the lein repl:

~/cool/tools > clj
Clojure 1.9.0
user=> (+ 2 3)
5
user=> exit
CompilerException java.lang.RuntimeException: Unable to resolve symbol: exit in 
this context, compiling:(NO_SOURCE_PATH:0:0)
user=>
user=> quit
CompilerException java.lang.RuntimeException: Unable to resolve symbol: quit in 
this context, compiling:(NO_SOURCE_PATH:0:0)
user=> ^D
~/cool/tools >

Lein repl for comparison:

~/tupelo > lein repl
nREPL server started on port 37115 on host 127.0.0.1 - Clojure 1.9.0
tupelo.core=> exit
Bye for now!
~/tupelo >
~/tupelo > lein repl
nREPL server started on port 40639 on host 127.0.0.1 - Clojure 1.9.0
tupelo.core=> quit
Bye for now!
~/tupelo >

The new repl does terminate upon CRTL-D or CRTL-C, but many users will probably 
be confused that `quit` and `exit` are not accepted.

Should I file a JIRA?

Alan


--
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<mailto: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<mailto:clojure%2bunsubscr...@googlegroups.com>
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 
clojure+unsubscr...@googlegroups.com<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
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
---
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 
clojure+unsubscr...@googlegroups.com<mailto:clojure+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Terminating 'clj' REPL session

2017-12-09 Thread Alex Miller
This really just the standard behavior of clojure.main, not a feature of the 
clj tool, so this would require a change in Clojure itself.

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Terminating 'clj' REPL session

2017-12-09 Thread Justin Smith
I find the fact that "exit" and "quit" work in leiningen repls to be weird
- this doesn't follow the otherwise consistent rules of the language. What
about an exit function, something like

(defn exit
  ([] (exit 0))
  ([n] (System/exit n))

so that it's not an out of band special case input?

On Sat, Dec 9, 2017 at 2:38 PM Alan Thompson  wrote:

> Hi - Just downloaded the new Clojure 1.9.0 package.  When I tried the repl
> I noticed that it doesn't respond to either `exit` or `quit` as one might
> expect from the lein repl:
>
> ~/cool/tools > clj
> Clojure 1.9.0
> user=> (+ 2 3)
> 5
> user=> exit
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> exit in this context, compiling:(NO_SOURCE_PATH:0:0)
> user=>
> user=> quit
> CompilerException java.lang.RuntimeException: Unable to resolve symbol:
> quit in this context, compiling:(NO_SOURCE_PATH:0:0)
> user=> ^D
> ~/cool/tools >
>
>
> Lein repl for comparison:
>
> ~/tupelo > lein repl
> nREPL server started on port 37115 on host 127.0.0.1 - Clojure 1.9.0
> tupelo.core=> exit
> Bye for now!
>
> ~/tupelo >
>
> ~/tupelo > lein repl
> nREPL server started on port 40639 on host 127.0.0.1 - Clojure 1.9.0
> tupelo.core=> quit
> Bye for now!
> ~/tupelo >
>
>
> The new repl does terminate upon CRTL-D or CRTL-C, but many users will
> probably be confused that `quit` and `exit` are not accepted.
>
> Should I file a JIRA?
>
> Alan
>
> --
> 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
> ---
> 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 clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Terminating 'clj' REPL session

2017-12-09 Thread Alan Thompson
Hi - Just downloaded the new Clojure 1.9.0 package.  When I tried the repl
I noticed that it doesn't respond to either `exit` or `quit` as one might
expect from the lein repl:

~/cool/tools > clj
Clojure 1.9.0
user=> (+ 2 3)
5
user=> exit
CompilerException java.lang.RuntimeException: Unable to resolve symbol:
exit in this context, compiling:(NO_SOURCE_PATH:0:0)
user=>
user=> quit
CompilerException java.lang.RuntimeException: Unable to resolve symbol:
quit in this context, compiling:(NO_SOURCE_PATH:0:0)
user=> ^D
~/cool/tools >


Lein repl for comparison:

~/tupelo > lein repl
nREPL server started on port 37115 on host 127.0.0.1 - Clojure 1.9.0
tupelo.core=> exit
Bye for now!

~/tupelo >

~/tupelo > lein repl
nREPL server started on port 40639 on host 127.0.0.1 - Clojure 1.9.0
tupelo.core=> quit
Bye for now!
~/tupelo >


The new repl does terminate upon CRTL-D or CRTL-C, but many users will
probably be confused that `quit` and `exit` are not accepted.

Should I file a JIRA?

Alan

-- 
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
--- 
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 clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.