chickadee » expand-full

expand-full

Full macro expansion.

Documentation

expand*

expand* FORMprocedure

Returns the expansion of FORM.

pretty-print-expand*

pretty-print-expand* FORMprocedure

Pretty-prints the expansion of FORM.

ppexpand* is a synonym.

Chicken Interpreter

Adds the toplevel command ,x* FORM.

Usage

(import expand-full)
csi -R expand-full

Examples

Notes

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.

Requirements

srfi-1 test-utils

Author

Kon Lovett

Repository

This egg is hosted on the CHICKEN Subversion repository:

https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/expand-full

If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.

Version history

2.2.0
Quit early. New test-runner.
2.0.0
CHICKEN 5 release.

License

Copyright (C) 2009-2024 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.

Contents »