4 ms·
Since lisp is homoiconic (refreshed on this, see downvotes below) it would be nice if you could type things into a repl and then run a function like this: (pers
by cturner 12y ago
Since lisp is homoiconic (refreshed on this, see downvotes below) it would be nice if you could type things into a repl and then run a function like this: (persist function-i-just-wrote). And then it would save to a text file. Then you wouldn't need to stuff around with the mouse copying from one buffer to another and the like.
(I expect something similar is possible in emacs, but emacs is not my thing.)
Hmm. I suppose I could just write the persist function myself. Watch this space.
- dedward 12y agoWhat you just described is pretty much universally handled by editor integration.... I can't imagine anyone actually develops lisp without this. The editor is hooked directly up to a running image.. a keypress (or two) causes an expression to be executed in the running image... you can flip to the REPL and goof around directly and/or at the same time work from one or more editor buffers and selectively execute code as you desire. You can bust into the debugger whenever you feel like it, etc etc. Someone else described it better above I think - but this image-based interaction is one of the most attractive things for many - it goes well beyond just having a REPL where you can evaluate code... lisp was basically designed around the idea of interactive development. If you think this through to a large, complex project - you can have a giant running application, working in production, and still attach to it with an editor/environment and debug it live... that's hard to do with anything else.
- pvaldes 12y agothis is easy: you only need to wrap your function in the body of a 'with-output-to-file' macro. You can send the output also to a stream, to a string, or use the * as stream name to grab the stdout also if i'm remembering correctly Is possible.