On Dec 17, 2008, at 2:27 PM, Rich Hickey wrote:

Thanks!

You're welcome!

Wow, that's a lot of changes. I'm not sure about this one:

- Exceptions caught by the repl now cause the rest of the input line to be skipped.

In what way is that the right thing to do?

The idea was that the sequence of top level forms may each depend on the success of the previous one. It can easily be changed to consider them all independent and I'll be happy to do that.

I'm quite concerned about compatibility, especially with all the read-line stuff. I remember some nightmares:

I know you're talking about unexpected nightmares. I think testing by others would be wise and I welcome it. These specific ones came up in my own testing I believe the patched code handles them well.

http://groups.google.com/group/clojure/browse_frm/thread/e818dabbd9ce7cb5/cfcc9d37934f844a

The patched code is careful never to push back -1.

http://groups.google.com/group/clojure/browse_frm/thread/16843146286cc16c/795e028ed81905c0

In LNPBR I only changed readLine. I followed the documentation for LineNumberReader.readLine for how it handles carriage return, linefeed, crlf, and end of stream. I implemented what I believe to be a correct/faithful algorithm in LNPBR.readLine and clojure.main/ process-return. I did test cr handling using in the patched LNPBR.readline with with-in-str.

http://java.sun.com/j2se/1.5.0/docs/api/java/io/LineNumberReader.html#readLine()

Are these changes compatible with the interactions done via, say, emacs inferior lisp mode? It's important to consider the fact that the repl can be interacted with by programs, not just people.

Good point. Slime already implements its own (socket) repl. (read- line) in it appears not to work either before or after the patch. Otherwise, it seems to work.

I tried inferior lisp mode directly. It behaves well--exactly the same as I've been seeing from a terminal with the patch in place.

Could someone please try it with Gorilla?

Has anyone tried this patch under Windows?

I have not. I would appreciate help with that. I'll try it on Windows tonight, but it would be much better to get info from someone who uses Clojure on Windows often.

There also seems to be a difference in behavior between clojure.main and Repl regarding shutdown:

http://groups.google.com/group/clojure/msg/eea16032c5b6b591

is that difference in the patch?

No, that difference was present in clojure.main before this patch. clojure.main/-main needs to call System/exit. The argument passed to System/exit could be 0 all the time or could be sensitive to the success of the run by criteria we could define. I'm happy with it being 0 all the time--requiring a script to call System/exit with another argument itself it it wants to communicate status to a caller. We could revisit that in the future if necessary.

I also replied in the other thread.

I guess I'm looking for recommendations about how best to test this short of a push-it-and-(briefly)-break-all-svn-users.

I'm open to any ideas along those lines. Are there volunteers to test? to review the code? to suggest a better way to fix read-line?

--Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to