I definitely see one thing I need to do and that is how errors in macro expansion are displayed.
Some comments which I think will explain what has gone wrong.
One important thing to realise is that CL packages and LFE/Erlang modules are very different things. For instance:
- Modules aren't namespaces, there is only one namespace which contains all names.
- LFE modules are the unit of code handling, they are compiled as one unit and no function is accessible until the module has been compiled and loaded into the system. Functions can't be added or removed from a module without recompiling it all.
- This means the separation between compile-time and run-time is very strict. So when macros are expanded they can't call functions in the module itself. They don't exist yet. This may be relaxed in the future but then the functions will be interpreted.
- Macros are specially treated and are interpreted at compile-time.
- You can functions with the same name but different number of arguments, arity, and they are different functions. Functions cannot have a variable number of arguments. So when you specify a function you must give it module, name, and arity, for example with #'foo:bar/3 .
- Symbols don't really have a function value in the sense that you can apply a symbol.
- No truthy values, LFE uses true/false as booleans.
These are all properties of the underlying Erlang system which we can't do anything about. It means that while LFE looks like CL in many ways it is actually a different lisp.
So in your code you can't call the local mapcar from your macro and trying to use '+ as a function just means you are using the symbol. There is a cl module with some of the standard CL library functions, for example mapcar.
I hope this helps you get going, but remember it is a different lisp. Try going to
http://lfe.io/ for more help
Robert