This issue describes how to implement the code-as-data concept exercise for the Common Lisp track.
Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
CL-PPCRE uses compiler macros to translate many regular expressions into normal lisp code, leading to a very high-performance regex library – it's all just sugar for s-expressions.
Representer
We may need to double check that "variable-like" symbols being defined in macros are properly replaced with a name mapping
Analyzer
Nothing yet, should be able to use macroexpand to help with tests
Implementing
While it's important that the student knows how to debug macros using things like macroexpand, that's not something we need to test for.
This one might be one of the trickier concepts, even if the functions and syntax involved aren't that complex. It's vital that the student understands what macros are good for and what they aren't, so that they don't over-apply them. Convincing examples are important here, even if they aren't super trivial. See "What Macros are For" for an example.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.
This issue describes how to implement the
code-as-data
concept exercise for the Common Lisp track.Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Please also watch the following video:
Learning objectives
defmacro
defmacro
vsdefun
defmacro
anddefun
(arguments aren't evaluated, macros can't bemap
ped,funcall
ed, orapply
d)`
,,
, and,@
)macroexpand
Out of scope
gensym
Concepts
code-as-data
Prerequisites
basic-lists
arithmetic
symbols
function-definition
expressions
enumeration
higher-order-functions
Resources to refer to
Hints
After
Representer
We may need to double check that "variable-like" symbols being defined in macros are properly replaced with a name mapping
Analyzer
Nothing yet, should be able to use
macroexpand
to help with testsImplementing
While it's important that the student knows how to debug macros using things like
macroexpand
, that's not something we need to test for.This one might be one of the trickier concepts, even if the functions and syntax involved aren't that complex. It's vital that the student understands what macros are good for and what they aren't, so that they don't over-apply them. Convincing examples are important here, even if they aren't super trivial. See "What Macros are For" for an example.
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.