On Wed, Sep 23, 2009 at 12: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".


Or turn on logging in xterm.

But all of these assume a unix environment and a standalone REPL. A
Windows/Mac user can use an IDE's integrated REPL and that will probably
have a backscroll they can copy and paste from. I can confirm that NetBeans
with Enclojure on Windows allows copy/pasting the entire REPL history or any
fragment of it, and without futzing around with either screen or the options
dialog of a terminal emulator. :) Eclipse with Counterclockwise will
probably be similar.

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. At the very least you will be able to
paste it into a blank text file in the same editor, save it, and attach it
to outgoing mail from your mail client. Your mail client might provide a way
to paste or load a text file directly into a mail body (not as an
attachment), and other software might provide a way to view and copy from
text files in a way that you can paste what was copied into other
applications. If the editor is run in a GUI terminal emulator and the code
from the REPL will all fit on the screen at once, the emulator's mark/copy
mode will work and can paste into a GUI mail client, or via terminal
emulator paste into pine or any other oddball pre-GUI mail client you might
prefer. So copying to a list post or other external place should still be
doable but might be a bit of a pain with those two environments.

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

Reply via email to