Outdated egg!
This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.
If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.
expand-full
Full macro expansion.
TOC »
Documentation
expand*
- expand* FORMprocedure
Returns the full expansion of FROM.
pretty-print-expand*
- pretty-print-expand* FORMprocedure
Pretty-prints the full expansion of FROM.
ppexpand* is a synonym.
Chicken Interpreter
Adds the toplevel command ,x* FORM.
Usage
(require-extension expand-full)
csi -R expand-full
Examples
Notes
Requirements
Bugs and Limitations
expand-full simply invokes the core expand procedure iteratively until nothing remains to be expanded. Unfortunately, each expand step returns the expansion of the outermost macro only, discarding the syntactic environment used in that expansion.
This means that if the expansion uses any macros that were introduced in the expansion or if it uses macros that are only available within the module in which the macro was defined, the next expansion step won't know about these macros, and will fail to expand correctly.
The upshot of all this is that expand-full is only useful for expansion of trivial macros. More specifically, it works only for macros that expand only to other top-level macros. This includes recursive macros which expand to self-invocations. Unfortunately, this is a fundamental limitation of the core expand form, which means it's an unfixable problem for this egg.
Author
Version history
- 1.0.5
- Needs vector-lib
- 1.0.4
- Fix expand* - expand vector & condition on a proper-list. Better csi help message.
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- Initial release.
License
Copyright (C) 2009 Kon Lovett. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.