1 Implementing Dr Scheme Tools
2 Adding Languages to Dr Scheme
3 Creating New Kinds of Dr Scheme Frames
4 Extending the Existing Dr Scheme Classes
5 Expanding the User’s Program Text and Breaking
6 Editor Modes
7 Language-specific capabilities
8 drscheme: get/ extend
9 drscheme: unit
10 drscheme: language
11 drscheme: language-configuration
12 drscheme: debug
13 drscheme: rep
14 drscheme: frame
15 drscheme: help-desk
16 drscheme: eval
17 drscheme: modes
Index
Version: 4.0.2

 

5 Expanding the User’s Program Text and Breaking

Macro-expanding a program may involve arbitrary computation and requires the setup of the correct language. To aid this, DrScheme’s tool interface provides drscheme:eval:expand-program to help. Use this method to extract the fully expanded program text in a particular language.

Because expanding the user’s program may require DrScheme to evaluate arbitrary code that the user wrote, tools that expand the user’s program should also allow the user to break the expansion. To help with this, the tools interfaces provides these methods: enable-evaluation and disable-evaluation. Since your tool will be expanding the program text, you should be both overriding enable-evaluation and disable-evaluation to disable your tool and calling them to ensure that only one expansion is happening at a time.

Finally, DrScheme provides the set-breakables method. This method controls what behavior the Break button has.