Re: Getting REPL transcript
Enclojure has repl history as well as a log of all the unique commands issued that persists across restarts of Netbeans (and your repl instances). The command history can be opened in the editor and the expressions can be executed just like any other clojure source file. Standard command history support (up and down arrow to toggle) is supported as well. This functionality is completely separated from anything Netbeans specific. You just need to implement an interface for the history viewer. All the libs up on github for the Enclojure project with the exception of the enclojure.plugin.netbeans library are not reliant on anything but java and clojure (no Netbeans). Eric On Sep 23, 2009, at 1:09 PM, John Harrop wrote: On Wed, Sep 23, 2009 at 1:05 PM, Fogus mefo...@gmail.com wrote: If you're running it with JLine, then the transcript is usually stored in ~/.jline-clojure.lang.Repl.history Actually, that suggests a more general point: that we can have programmatic access to the REPL's backlog if we modify the REPL process's Java code somewhat. A simple example would be to make a repl.class that would provide an interactive stdin/stdout repl but log everything to a ./repl.log file or whatever. This could be used to obtain a text file with the interaction history afterward, to massage, cut and paste from, etc. to one's heart's content in a text editor. Even on MS-DOS, if anyone still uses such a dinosaur. :) --~--~-~--~~~---~--~~ 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: Getting REPL transcript
Thank you all. Chris Grand has figured it out for me. However, I invite you to look at it and comment. Regards, Emeka On Sat, Sep 26, 2009 at 12:15 PM, Daniel Werner daniel.d.wer...@googlemail.com wrote: On Sep 23, 6:20 pm, Emeka emekami...@gmail.com wrote: Hello All, I would like to have a transcript of Repl. Could someone help me out here? Regards, Emeka If you use rlwrap, you can give it the --log-file (-l) argument: $ rlwrap -l repl.log java -cp ... --~--~-~--~~~---~--~~ 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: Getting REPL transcript
On Sep 23, 6:20 pm, Emeka emekami...@gmail.com wrote: Hello All, I would like to have a transcript of Repl. Could someone help me out here? Regards, Emeka If you use rlwrap, you can give it the --log-file (-l) argument: $ rlwrap -l repl.log java -cp ... --~--~-~--~~~---~--~~ 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: Getting REPL transcript
Sorry, here is the link. http://gist.github.com/193550 On Sat, Sep 26, 2009 at 2:03 PM, Emeka emekami...@gmail.com wrote: Thank you all. Chris Grand has figured it out for me. However, I invite you to look at it and comment. Regards, Emeka On Sat, Sep 26, 2009 at 12:15 PM, Daniel Werner daniel.d.wer...@googlemail.com wrote: On Sep 23, 6:20 pm, Emeka emekami...@gmail.com wrote: Hello All, I would like to have a transcript of Repl. Could someone help me out here? Regards, Emeka If you use rlwrap, you can give it the --log-file (-l) argument: $ rlwrap -l repl.log java -cp ... --~--~-~--~~~---~--~~ 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: Getting REPL transcript
I'm still learning, myself, so I could be wrong, but you might be able to use clojure.contrib.server-socket and tweak it's binding for *in*, *out*, and *err*, like another PushbackInputStream for *in* and copy the lines to a file before sending it into the repl. Or use a pipe perhaps? -- John --~--~-~--~~~---~--~~ 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: Getting REPL transcript
Thanks I will look into that. But more information on 'pipe' please? So we have two Newman{Rich, John}, so I will say thanks to Newmen. Regards, Emeka On Fri, Sep 25, 2009 at 10:43 AM, John Newman john...@gmail.com wrote: I'm still learning, myself, so I could be wrong, but you might be able to use clojure.contrib.server-socket and tweak it's binding for *in*, *out*, and *err*, like another PushbackInputStream for *in* and copy the lines to a file before sending it into the repl. Or use a pipe perhaps? -- John --~--~-~--~~~---~--~~ 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: Getting REPL transcript
On Sep 23, 1:09 pm, John Harrop jharrop...@gmail.com wrote: Actually, that suggests a more general point: that we can have programmatic access to the REPL's backlog if we modify the REPL process's Java code somewhat. The REPL is written in Clojure, so it's quite easy to modify. Look at src/clj/clojure/main.clj in the recent Clojure sources. -SS --~--~-~--~~~---~--~~ 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: Getting REPL transcript
Hello John , A standalone REPL on Windows is amenable to making the command prompt window's backscroll big enough, if needed, and then copying from it using the prompt window's mark/copy mode. A standalone REPL on MS-DOS is tougher. The only way I know of short of installing Windows is to redirect the REPL's output to a file, but then you'd have to interact with it blind, and since it has line editing on the prompt line, the file might have escape sequences and/or other cruft in it and need some postprocessing. It might be best in that case to create a text file with expressions you want to evaluate at the REPL, then run the REPL process with input redirected from this file and output redirected to another file, to get a clean output and not have to type blind. The downside is this isn't as interactive; you can't change your mind or decide stuff after seeing some of the results, but only after seeing ALL of the results and then altering the input file. I want it to work as standalone REPL on MS-DOS. You said it is tougher,then am hopeless. I don't intend to interact with log file(for now I don't have that idea) , I would want to use it later for historical studies and may be other things. Could you give me a lead? Regards, Emeka I'd recommend against using a standalone REPL on DOS, or on terminal-mode Unix which is only slightly friendlier thanks to the availability of screen. Use a terminal emulator from a GUI desktop, if not an IDE. --~--~-~--~~~---~--~~ 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: Getting REPL transcript
Actually, that suggests a more general point: that we can have programmatic access to the REPL's backlog if we modify the REPL process's Java code somewhat. A simple example would be to make a repl.class that would provide an interactive stdin/stdout repl but log everything to a ./repl.log file or whatever. This could be used to obtain a text file with the interaction history afterward, to massage, cut and paste from, etc. to one's heart's content in a text editor. Even on MS-DOS, if anyone still uses such a dinosaur. :) I've mentioned this before: http://www.franz.com/support/documentation/8.1/ansicl/dictentr/dribble.htm This problem has been solved for 25 years. --~--~-~--~~~---~--~~ 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: Getting REPL transcript
Rich, Hmm, it is what I'm looking for.Just the way I planned it to be. The next issue now is on how to craft it into clojure. Regards, Emeka On Thu, Sep 24, 2009 at 7:59 AM, Richard Newman holyg...@gmail.com wrote: Actually, that suggests a more general point: that we can have programmatic access to the REPL's backlog if we modify the REPL process's Java code somewhat. A simple example would be to make a repl.class that would provide an interactive stdin/stdout repl but log everything to a ./repl.log file or whatever. This could be used to obtain a text file with the interaction history afterward, to massage, cut and paste from, etc. to one's heart's content in a text editor. Even on MS-DOS, if anyone still uses such a dinosaur. :) I've mentioned this before: http://www.franz.com/support/documentation/8.1/ansicl/dictentr/dribble.htm This problem has been solved for 25 years. --~--~-~--~~~---~--~~ 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: Getting REPL transcript
2009/9/23 Emeka emekami...@gmail.com: Mic, Or use script . I don't think I understood clearly what you are referring to. There's a UNIX command called script which records a command line session to a file (called typescript by default). mich...@egret:/tmp$ script Script started, file is typescript mich...@egret:/tmp$ clojure Clojure 1.1.0-alpha-SNAPSHOT user= (defn hello [] (println Hello, World!)) #'user/hello user= (hello) Hello, World! nil user= mich...@egret:/tmp$ exit Script done, file is typescript Although if you use rlwrap to give you history and line editing then script will record all the terminal escape codes etc. to the typescript file too. So it's not perfect. -- Michael Wood esiot...@gmail.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: Getting REPL transcript
Emeka emekami...@gmail.com writes: I would like to have a transcript of Repl. Could someone help me out here? Sure; run it in GNU Screen with logging turned on. $ screen -l $ rlwrap java -cp clojure.jar clojure.main = (do some stuff) It will get written to screenlog.0. -Phil --~--~-~--~~~---~--~~ 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: Getting REPL transcript
2009/9/23 Phil Hagelberg p...@hagelb.org: Emeka emekami...@gmail.com writes: I would like to have a transcript of Repl. Could someone help me out here? Sure; run it in GNU Screen with logging turned on. $ screen -l $ rlwrap java -cp clojure.jar clojure.main = (do some stuff) It will get written to screenlog.0. Or use script. I'm sure there was a thread about this a few months ago. There might be some more useful suggestions if you manage to find it in the archives. -- Michael Wood esiot...@gmail.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: Getting REPL transcript
Mic, Or use script . I don't think I understood clearly what you are referring to. Regards, Emeka On Wed, Sep 23, 2009 at 4:40 PM, Michael Wood esiot...@gmail.com wrote: 2009/9/23 Phil Hagelberg p...@hagelb.org: Emeka emekami...@gmail.com writes: I would like to have a transcript of Repl. Could someone help me out here? Sure; run it in GNU Screen with logging turned on. $ screen -l $ rlwrap java -cp clojure.jar clojure.main = (do some stuff) It will get written to screenlog.0. Or use script. I'm sure there was a thread about this a few months ago. There might be some more useful suggestions if you manage to find it in the archives. -- Michael Wood esiot...@gmail.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: Getting REPL transcript
If you're running it with JLine, then the transcript is usually stored in ~/.jline-clojure.lang.Repl.history --~--~-~--~~~---~--~~ 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: Getting REPL transcript
On Wed, Sep 23, 2009 at 1:05 PM, Fogus mefo...@gmail.com wrote: If you're running it with JLine, then the transcript is usually stored in ~/.jline-clojure.lang.Repl.history Actually, that suggests a more general point: that we can have programmatic access to the REPL's backlog if we modify the REPL process's Java code somewhat. A simple example would be to make a repl.class that would provide an interactive stdin/stdout repl but log everything to a ./repl.log file or whatever. This could be used to obtain a text file with the interaction history afterward, to massage, cut and paste from, etc. to one's heart's content in a text editor. Even on MS-DOS, if anyone still uses such a dinosaur. :) --~--~-~--~~~---~--~~ 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: Getting REPL transcript
Vimclojure and emacs (on any operating system) will have at least the ability to copy from the REPL's history and paste elsewhere in the editor, but maybe not any nice way to export it to something else, like the mail client used to post to this list. With emacs you can simply safe the buffer of the repl. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---