If you are saying "memorise what you commonly use" then that's fine, except that any typical program usually involves a lot of "lesser used" stuff as well.
If you are saying "memorise what you commonly use" then that's fine, except that any typical program usually involves a lot of "lesser used" stuff as well.
How? As in what commands/functions/macros?
Say I define a function and compile with slime, how do I get the repl to print it back to me? And with a function I loaded from an external library? Is there something like macroexpand-1 for functions which will print it out?
Common Lisp also has built in the function FUNCTION-LAMBDA-EXPRESSION, which returns the source for a function -> when Lisp has recorded its definition.
Try (DESCRIBE #'some-function) in SBCL to get information about the arglist, the types, the source file.
In a SLIME editor buffer try c-h m . This will display the buffer commands. There are a zillion of commands to get information about the symbols, code references, etc.
On my Lisp Machine:
Command: Show Source Code (a defined function spec) mts::init-facts
Source code for MTS::INIT-FACTS:
(defun init-facts ()
(setf *init-facts*
'((world (loc (actor joe) (val cave)))
(joe (loc (actor joe) (val cave)))
(world (loc (actor irving) (val oak-tree)))
(irving (loc (actor irving) (val oak-tree)))
(joe (loc (actor irving) (val oak-tree)))
(world (loc (actor water) (val river)))
(joe (loc (actor water) (val river)))
(world (loc (actor honey) (val elm-tree)))
(irving (loc (actor honey) (val elm-tree)))
(world (loc (actor worm) (val ground)))
(joe (loc (actor worm) (val ground)))
(irving (loc (actor joe) (val cave)))
(world (loc (actor fish) (val river)))
(irving (loc (actor fish) (val river))))))
Command: Show Callers (a symbol [default MTS::INIT-FACTS]) MTS::INIT-FACTS
MTS::MICRO-TALESPIN calls MTS::INIT-FACTS as a function.
MTS::MICRO-TALESPIN-DEMO calls MTS::INIT-FACTS as a function.
Done.
Command:As opposed to say learning the standard library relating to MIDI access, or file IO, or other specialized things that in theory could be a library and aren't really core.
It might sound a little like syntax, but because Lisps have such a lean syntax, there's a lot of the fundamental constructs that are part of the standard library and they are more what I'm referring too.
For example you'll have things like: car, cdr, append, mapcar, some, every, symbols, keywords, loop, intern, quote, format, butlast, intersection, union, multiple-value-bind, apply, funcall, =, eq, eql, if, unless, typecase, cond, dolist, iterate, etc.
What often happens in Lisps is that each core function is very powerful and becomes almost a mini-DSL. So it takes a while to really learn about all those and have them memorized by heart so you don't constantly need to refer to the documentation about what they do and how they work and how to use them. And often their power comes when they are combined together as well, and that also takes some time to learn all the valid ways of combining them.
Before you are familiar with all that and it's second nature, almost instinctive, you'll be a lot slower to read and write code.