Hi there,
first of all Paul and Dave, thanks for replying!! The question can perhaps be best explained with an example:
repl=> (defun doit-3 (x) (* 3 x)) repl=> '(some more cool stuff) repl=>'(and more and more)
i keep testing and playing around with functions more and more
I can certainly run my doit-3 function
repl=>(doit-3 4) 12 repl=>
and now, I say to myself, - how the heck did I write that doit-3, I forgot, because, I wrote it 20 minutes ago, it obviously exists inside REPL because I can execute it... So, how do I view [dump??] the contents of doit-3 to the screen, or to a file on the disk, so I can invoke an editor and modify doit-3 and then reload it??
I am just interested in learning how to be more productive in a standard software development cycle.
Thanks, Alex.
On Wed, Oct 6, 2010 at 4:59 PM, Paul Tarvydas < tarvydas@visualframeworksinc.com> wrote:
Hi there,
A bit of a noob question - let's say that I have an interactive Repl session that has been going on for about an hour or so, and all of a sudden I wish to modify a defun I wrote a while ago. What is the easiest way first to show that code on the console, modify it, and load it back into Repl ?
I am just trying to come up with a comfortable development environment for myself.
There is something called "(dribble)" which records a transcript of your session. I've never used it.
With LW, I typically use the editor to type into a file (buffer) and compile-load the buffer, or ^E one form or defun. Undo can get you back to an earlier state. I find that if I'm experimenting, I do it a function at a time, until I'm happy with it, so I never have to go back a full hour.
I take it that most free lisp users use emacs+slime. You split the emacs window into two, one half shows your edit buffer, the other shows a lisp interaction. A keystroke sends your current form to the interaction and you see the result in the interaction buffer.
pt
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
Hi Aleksandar!
Like Paul, I can only speak for LispWorks. While working in the Listener, the "History Search" command can be invoked with ALT+R. In the minibuffer you will be able to enter 'doit-3' and press enter. The DEFUN for 'doit-3' will appear at the prompt.
Perhaps there is something similar in other environments?
Cheers, Brian Connoy
p.s. Sorry, I didn't get to meet you at the last meet.
From: Aleksandar Matijaca [mailto:amatijaca@gmail.com] Sent: Wednesday, October 06, 2010 10:48 PM To: toronto-lisp@common-lisp.net Subject: [toronto-lisp] Fwd: Development helpers
Hi there,
first of all Paul and Dave, thanks for replying!! The question can perhaps be best explained with an example:
repl=> (defun doit-3 (x) (* 3 x)) repl=> '(some more cool stuff) repl=>'(and more and more)
i keep testing and playing around with functions more and more
I can certainly run my doit-3 function
repl=>(doit-3 4) 12 repl=>
and now, I say to myself, - how the heck did I write that doit-3, I forgot, because, I wrote it 20 minutes ago, it obviously exists inside REPL because I can execute it... So, how do I view [dump??] the contents of doit-3 to the screen, or to a file on the disk, so I can invoke an editor and modify doit-3 and then reload it??
I am just interested in learning how to be more productive in a standard software development cycle.
Thanks, Alex.
On Wed, Oct 6, 2010 at 4:59 PM, Paul Tarvydas <tarvydas@visualframeworksinc.commailto:tarvydas@visualframeworksinc.com> wrote:
Hi there,
A bit of a noob question - let's say that I have an interactive Repl session that has been going on for about an hour or so, and all of a sudden I wish to modify a defun I wrote a while ago. What is the easiest way first to show that code on the console, modify it, and load it back into Repl ?
I am just trying to come up with a comfortable development environment for myself.
There is something called "(dribble)" which records a transcript of your session. I've never used it.
With LW, I typically use the editor to type into a file (buffer) and compile-load the buffer, or ^E one form or defun. Undo can get you back to an earlier state. I find that if I'm experimenting, I do it a function at a time, until I'm happy with it, so I never have to go back a full hour.
I take it that most free lisp users use emacs+slime. You split the emacs window into two, one half shows your edit buffer, the other shows a lisp interaction. A keystroke sends your current form to the interaction and you see the result in the interaction buffer.
pt _______________________________________________ toronto-lisp mailing list toronto-lisp@common-lisp.netmailto:toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
Since doit-3 "lives" inside the vm via Repl , it seems logical that somehow one should be able to "dump it" to file or to the console etc. Copy into a clipboard would be good too.
Sent from my iPhone
On 2010-10-07, at 9:58, Brian Connoy BConnoy@morrisonhershfield.com wrote:
Hi Aleksandar!
Like Paul, I can only speak for LispWorks. While working in the Listener, the “History Search” command can be invoked with ALT+R. In the minibuffer you will be able to enter ‘doit-3’ and press enter. The DEFUN for ‘doit-3’ will appear at the prompt.
Perhaps there is something similar in other environments?
Cheers,
Brian Connoy
p.s. Sorry, I didn’t get to meet you at the last meet.
*From:* Aleksandar Matijaca [mailto:amatijaca@gmail.com] *Sent:* Wednesday, October 06, 2010 10:48 PM *To:* toronto-lisp@common-lisp.net *Subject:* [toronto-lisp] Fwd: Development helpers
Hi there,
first of all Paul and Dave, thanks for replying!! The question can perhaps be best explained
with an example:
repl=> (defun doit-3 (x)
(* 3 x))
repl=> '(some more cool stuff)
repl=>'(and more and more)
i keep testing and playing around with functions
more and more
I can certainly run my doit-3 function
repl=>(doit-3 4)
12
repl=>
and now, I say to myself, - how the heck did I write that doit-3, I forgot, because,
I wrote it 20 minutes ago, it obviously exists inside REPL because I can execute it...
So, how do I view [dump??] the contents of doit-3 to the screen, or to a file on the
disk, so I can invoke an editor and modify doit-3 and then reload it??
I am just interested in learning how to be more productive in a standard software
development cycle.
Thanks, Alex.
On Wed, Oct 6, 2010 at 4:59 PM, Paul Tarvydas < tarvydas@visualframeworksinc.com> wrote:
Hi there,
A bit of a noob question - let's say that I have an interactive Repl session that has been going on for about an hour or so, and all of a sudden I wish to modify a defun I wrote a while ago. What is the easiest way first to show that code on the console, modify it, and load it back into Repl ?
I am just trying to come up with a comfortable development environment for myself.
There is something called "(dribble)" which records a transcript of your session. I've never used it.
With LW, I typically use the editor to type into a file (buffer) and compile-load the buffer, or ^E one form or defun. Undo can get you back to an earlier state. I find that if I'm experimenting, I do it a function at a time, until I'm happy with it, so I never have to go back a full hour.
I take it that most free lisp users use emacs+slime. You split the emacs window into two, one half shows your edit buffer, the other shows a lisp interaction. A keystroke sends your current form to the interaction and you see the result in the interaction buffer.
pt
_______________________________________________ toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
_______________________________________________ toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
Oops, sorry. Appears as though I misunderstood your question, thinking "console" was also a reference to the REPL.
I've grown so used to 'dumping' forms from the Editor buffer into the Listener, it never occurred to me I might want to go in the other direction as well. I'll try looking further into this for LW.
BC
From: Aleksandar Matijaca [mailto:amatijaca@gmail.com] Sent: Thursday, October 07, 2010 10:08 AM To: toronto-lisp@common-lisp.net Subject: Re: [toronto-lisp] Fwd: Development helpers
Since doit-3 "lives" inside the vm via Repl , it seems logical that somehow one should be able to "dump it" to file or to the console etc. Copy into a clipboard would be good too.
Sent from my iPhone
On 2010-10-07, at 9:58, Brian Connoy <BConnoy@morrisonhershfield.commailto:BConnoy@morrisonhershfield.com> wrote: Hi Aleksandar!
Like Paul, I can only speak for LispWorks. While working in the Listener, the "History Search" command can be invoked with ALT+R. In the minibuffer you will be able to enter 'doit-3' and press enter. The DEFUN for 'doit-3' will appear at the prompt.
Perhaps there is something similar in other environments?
Cheers, Brian Connoy
p.s. Sorry, I didn't get to meet you at the last meet.
From: Aleksandar Matijaca [mailto:amatijaca@gmail.commailto:amatijaca@gmail.com] Sent: Wednesday, October 06, 2010 10:48 PM To: toronto-lisp@common-lisp.netmailto:toronto-lisp@common-lisp.net Subject: [toronto-lisp] Fwd: Development helpers
Hi there,
first of all Paul and Dave, thanks for replying!! The question can perhaps be best explained with an example:
repl=> (defun doit-3 (x) (* 3 x)) repl=> '(some more cool stuff) repl=>'(and more and more)
i keep testing and playing around with functions more and more
I can certainly run my doit-3 function
repl=>(doit-3 4) 12 repl=>
and now, I say to myself, - how the heck did I write that doit-3, I forgot, because, I wrote it 20 minutes ago, it obviously exists inside REPL because I can execute it... So, how do I view [dump??] the contents of doit-3 to the screen, or to a file on the disk, so I can invoke an editor and modify doit-3 and then reload it??
I am just interested in learning how to be more productive in a standard software development cycle.
Thanks, Alex.
On Wed, Oct 6, 2010 at 4:59 PM, Paul Tarvydas <tarvydas@visualframeworksinc.commailto:tarvydas@visualframeworksinc.com> wrote:
Hi there,
A bit of a noob question - let's say that I have an interactive Repl session that has been going on for about an hour or so, and all of a sudden I wish to modify a defun I wrote a while ago. What is the easiest way first to show that code on the console, modify it, and load it back into Repl ?
I am just trying to come up with a comfortable development environment for myself.
There is something called "(dribble)" which records a transcript of your session. I've never used it.
With LW, I typically use the editor to type into a file (buffer) and compile-load the buffer, or ^E one form or defun. Undo can get you back to an earlier state. I find that if I'm experimenting, I do it a function at a time, until I'm happy with it, so I never have to go back a full hour.
I take it that most free lisp users use emacs+slime. You split the emacs window into two, one half shows your edit buffer, the other shows a lisp interaction. A keystroke sends your current form to the interaction and you see the result in the interaction buffer.
pt _______________________________________________ toronto-lisp mailing list toronto-lisp@common-lisp.netmailto:toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
_______________________________________________ toronto-lisp mailing list toronto-lisp@common-lisp.netmailto:toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
Since doit-3 "lives" inside the vm via Repl , it seems logical that somehow one should be able to "dump it" to file or to the console etc. Copy into a clipboard would be good too.
It's my understanding that there is "no" VM in most of the CL's. What you type at the repl is (jit) compiled to machine code, then executed.
In LW, there are cases where the code is interpreted, though. I've seen this occur when I set a breakpoint using the GUI debugger.
Doug mentioned "describe" and that, in some implementations the original source code is attached to the function symbol, accessible to describe, but, AFAIK, this is not required by the spec.
So, you have to tell us which CL implementation you are using, and hope that someone is familiar with it. I think you mentioned LW personal, iirc. If you are using LW, then it appears that most LW'ers don't use the listener in the way you intend to, and there are ways to do the same thing in LW that are more convenient (already mentioned).
If you wish to use the repl, dribble is part of the spec. It appears that if you say (dribble "filename") at the beginning of you session, you will get a file that you can edit later. Some implementations allow emacs keystrokes at the command prompt that allow you access to the undo history.
Now that I mention it, the LW listener uses ALT-P in the listener repl to go backwards in time. Likewise, the listener is a stream buffer - just use the scroll bar to go backwards, position your cursor on a line and hit RETURN to bring it down to the current prompt. Some of that stuff may be documented in the LW User Guide.
pt
Thank you all for the suggestions. Half the battle for the lowly developer is making the development environment comfortable so that one can concentrate on learning and building stuff and not fighting the development environment.
Sent from my iPhone
On 2010-10-07, at 11:22, Paul Tarvydas tarvydas@visualframeworksinc.com wrote:
Since doit-3 "lives" inside the vm via Repl , it seems logical that somehow one should be able to "dump it" to file or to the console etc. Copy into a clipboard would be good too.
It's my understanding that there is "no" VM in most of the CL's. What you type at the repl is (jit) compiled to machine code, then executed.
In LW, there are cases where the code is interpreted, though. I've seen this occur when I set a breakpoint using the GUI debugger.
Doug mentioned "describe" and that, in some implementations the original source code is attached to the function symbol, accessible to describe, but, AFAIK, this is not required by the spec.
So, you have to tell us which CL implementation you are using, and hope that someone is familiar with it. I think you mentioned LW personal, iirc. If you are using LW, then it appears that most LW'ers don't use the listener in the way you intend to, and there are ways to do the same thing in LW that are more convenient (already mentioned).
If you wish to use the repl, dribble is part of the spec. It appears that if you say (dribble "filename") at the beginning of you session, you will get a file that you can edit later. Some implementations allow emacs keystrokes at the command prompt that allow you access to the undo history.
Now that I mention it, the LW listener uses ALT-P in the listener repl to go backwards in time. Likewise, the listener is a stream buffer - just use the scroll bar to go backwards, position your cursor on a line and hit RETURN to bring it down to the current prompt. Some of that stuff may be documented in the LW User Guide.
pt
toronto-lisp mailing list toronto-lisp@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/toronto-lisp
On 2010-10-07, at 11:31 AM, Aleksandar Matijaca wrote:
Thank you all for the suggestions. Half the battle for the lowly developer is making the development environment comfortable so that one can concentrate on learning and building stuff and not fighting the development environment.
Sent from my iPhone
I just realized I sent my earlier response directly to Aleksandr's email but not to the mailing list.
Short version: Do not rely on a REPL to get back what you typed into it. It's not for that, generally.
A top-level/REPL is a Read-Eval-Print-Loop, not a full IDE. (Some REPL implementations may let you up-arrow or similar to previous expressions. This is a minor convenience, but no substitute for an IDE.)
In modern Lisps, typing a form into a REPL compiles it. The fact that it is available for later use during that session in the REPL does no imply that the original stuff you typed in is around somewhere in the REPL. The function (or other form) is available on the REPL as a compiled object only.
To reliably get, e.g. source for your function doit-3 back, use a full IDE which provides a "source code" editor, one (or several) REPLs, and lots of other stuff. Create your functions and what have you as text files with your IDE's editor - not directly in its running REPL. Compile the forms in the text file on the fly one by one or all at once, etc. usinf the IDE. These forms will be available in the REPL running as part of your IDE (as compiled objects).
Moreover, as if by magic :-) Lisp forms that are stored in Lisp source code files can be made to persist for use another day, even after your REPL has been shut down for the night.
This is not to say that everything gets typed into a source file. You'll key lots of stuff directly into the REPL to test, learn, run an application, etc. Just don't depend on it to do what an IDE is meant to do.
- Dave -