Say I've played a bit with SBCL with no SLIME, no whatsoever, plain interpreter. Now I want to save couple of functions in a file. Not an core image, just a bits of code in a text form. How should I do that?
相关问题
- Json.NET deserializing contents of a JObject?
- Drakma and Dexador both fails at USocket call whil
- Serializing a serialized Thrift struct to Kafka in
- GeoDjango: Distance Object is not serializable
- How do I send or save a function and recv or resto
相关文章
- serializing a list of objects into a file in java
- Convert C# Object to Json Object
- When sending XML to JMS should I use TextMessage o
- Custom serialization for fields in Rails
- Do I need to expose a constructor in a WCF DataCon
- How to serialize Xml Date only from DateTime in C#
- Does learning one Lisp help in learning the other?
- Common Lisp: Why does my tail-recursive function c
There are two ways to do that: use
DRIBBLE
and/orFUNCTION-LAMBDA-EXPRESSION
The first is to always use the Common Lisp function
DRIBBLE
before experimenting:Dribble takes a pathname for a text file. Once called, the interactive IO will be written to that file.
See the file:
From above you should be able to see if you have any interesting functions entered... You could also set your SBCL (for example using the init file) to set up dribble always at start. Calling
(dribble)
without arguments ends a dribble.Next:
FUNCTION-LAMBDA-EXPRESSION
:Now you can call
FUNCTION-LAMBDA-EXPRESSION
to get the definition back. It might be slightly altered, but it should do the job to recover valuable ideas written as code:If you are using sb-readline or rlwrap you press up until you hit when it got defined and copy and paste itto a file. You might have it in the termial window history too.
If none of these works only compiled definitions are available then the only way to save them is by dumping core image.
For next time, you could make a macro that stores every definition source in a special variable so that you can easily retreive them.