robert-strandh / SICL

A fresh implementation of Common Lisp
Other
1.07k stars 79 forks source link

Macrolet similar code #12

Closed karlosz closed 10 years ago

karlosz commented 10 years ago

Abstract out highly repetitive boilerplate code for many functions in the standard library as well as conditions with macros/macrolets. Cf. CMUCL/SBCL's def macrolets for highly similar functions in the standard library.

robert-strandh commented 10 years ago

I agree that using macros is a good idea for boilerplate code.

However, in the case of the sequence functions, I find that it is impossible to make the macro expansion code readable. That is the main reason I didn't do it that way.

I would much prefer a solution with a few general versions (using completely different algorithms), and then having some code walker replace calls to the test functions and key functions with specialized versions.