Split files, add dependencies and remove copied/duplicate code
Created by: EuAndreh
This was a bigger refactor of the code. Changes:
- Removed
defmacro!
related code: imported code from defmacro-enhance, which took the code from the book, and made a more portable version of the code-walking. It is actively maintained and used by many projects. There's a difference in usage (as described in thedefmacro-enhance
's README):g!symbols
becomesg!-symbols
, ando!symbols
don't map tog!symbols
:o!symbols
becomeso!-symbols
and map too!-symbols
; - Code from Paul Graham's On Lisp (like
symb
orflatten
) was removed and imported from the source; - Removed the
#>
reader-macro: changed to cl-heredoc (as described in the errata); - Kept the named-readtables support;
- Added the file
readtable.lisp
, with all the read-macro related stuff, with a package calledlet-over-lambda.readtable
(with a nickname oflol.rt
); - Added the line
(cl-reexport:reexport-from :lol.rt)
at the end of thepackage.lisp
file: it uses the cl-reexport package and reexports from thelol
package all symbols fromlol.rt
. That way, one can(:import-from :let-over-lambda ...)
without having to know if the symbol is in thelol
package or in thelol.rt
package; - Improved the
#~
reader-macro: added support for Perl-like balanced regex delimiters. Ex:(#~m<abc> ...)
. Matching delimiters inserted are inmatching-delimiters
; - Changed the frunction called from the
#~m
reader-macro: instead ofppcre:scan
, now it callppcre:scan-to-strings
as it was found to be more practical in daily usage; - Changed
if-macro
: it allow nesting and binds$n
local variables accordingly.
TODO:
- Wait for the on-lisp package to become available in Quicklisp (I already created an issue, and hope that @DalekBaldwin will agree);
- Add some tests and check implementation independence (I can do it). Maybe add some examples from the book and put many corner cases to check compatibility with the code from the book (it can be done easily with Travis CI);
- Update the README, explaining the API and adding links to the code in the site (I can do it too =p );
- Add docstrings to functions and macros (And this too =p );
- Test the
if-match
macro (I can try it)