[erlang-questions] shell question - import commands from external file
Scott Lystig Fritchie
fritchie@REDACTED
Mon Sep 21 19:30:58 CEST 2009
John Hughes <john.hughes@REDACTED> wrote:
jh> Cut-and-paste?
Actually, I do that quite a bit. It isn't a tremendously pleasing thing
to do, but it does have a number of benefits that can add up to
something worthwhile. Not always, but enough that I keep doing it.
During initial development, I have 1-line or 2-line test cases that I
need use in the shell. I don't always follow test-driven-design
doctrine exactly, especially when the API of the function(s)/module that
I'm working on is still in flux.
I keep yet another "xterm" window open with either:
* cat > /dev/null
* a text editor (for more permanent notes).
If I have a command at the Erlang CLI that I believe I'll need again, I
cut-and-paste from the CLI to the cat/editor window.
The text editor flavor ends up being useful because I can save the stuff
to a file. (Power failures have a tendency to screw up "xterm" and
"cat", go figure.) I have such scribble notes from over 12 months ago
on one project. It forms extra history and documentation of how I was
using the functions back then, which has been a big help for writing
extra documentation now.(*)
On another method, a colleague of mine uses "rlwrap -a erl [args...]"
and swears that it's the best thing since the ball point pen.(**)
-Scott
(*) Never mind that I should have written the documentation at the same
time I wrote the code.
(**) Or sliced bread, I forget exactly.
See http://freshmeat.net/projects/rlwrap/
More information about the erlang-questions
mailing list