Note: This is taken from the Chicken Wiki, where a more recent version could be available.

Introduction

The peep extension can be loaded into the chicken compiler to interactively explore the internal database during compilation of a program.

Requirements

dissector.

chicken 2.621 or higher is required to use this extension.

If the readline extension is installed, the interactive prompt supports line-editing.

Usage

Pass peep to the -extend option while compiling a file. This sets the user-post-analysis-hook and will start a read-eval-print loop after all optimizations have been performed. You can enter a number of commands (described below) to inspect the analysis database and node tree.

See chicken-compilation-process and chicken-internal-structure for more information about the database and the way chicken compiles Scheme to C code.

Before the compilation starts, a file named .peeprc will be loaded, if it exists, either from the current directory, or from the user's home directory.

Commands

When the REPL is started, you can enter arbitrary Scheme expressions, including any of the following commands:

 (.pp [X])            [.p]     pretty-print node or other value (defaults to program graph)
 (.dump)              [.d]     dump database
 (.find NAME)         [.f]     find symbol in database
 (.show SYMBOL)       [.s]     show properties of symbol
 (.get SYMBOL PROP)   [.g]     get symbol property
 (.set SYMBOL PROP X)          set symbol property
 (.select PROP ...)   [.sel]   return list of symbols that have given properties
 (.inspect [X])       [.i]     inspect value (defaults to program graph)
 (.props)                      list valid symbol properties
 (.quit)              [.q]     continue compilation until finished
 (.continue [PASS])   [.c]     continue until PASS is reached or to next analysis
 (.help)              [.h]     show this message

The special expression # holds the result of the last entered expression.

Authors

felix winkelmann

License

Copyright (c) 2007, Felix L. Winkelmann
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
  Redistributions of source code must retain the above copyright notice, this list of conditions and the following
    disclaimer. 
  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
    disclaimer in the documentation and/or other materials provided with the distribution. 
  Neither the name of the author nor the names of its contributors may be used to endorse or promote
    products derived from this software without specific prior written permission. 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

Version History

0.2
.peeprc, adapted to CHICKEN 2.621, new commands, dropped readline requirement
0.1
initial release