[plt-scheme] scribble/eval - defs+int

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Apr 27 22:50:38 EDT 2010

At Tue, 27 Apr 2010 22:31:30 -0400, Eric Tanter wrote:
> I'm trying to figure out a way to insert some text in between Scheme 
> definitions: that is, have some definitions (@schemeblock or equivalent), with 
> their explanations (text mode), and then an interaction, like @interaction, 
> except that it should be aware of the preceeding definitions.
> I found out about @defs+int but it forces all definitions and the expr to be 
> defined in one shot.
> What would be the best way to do that?

You need to use `#:eval'. Example below.


#lang scribble/manual
@(require scribble/eval)

@(define ex-eval (make-base-eval))

First, we define @scheme[x]:

#:eval ex-eval
(define x 1)

Next, we use it:

#:eval ex-eval

@(close-eval ex-eval)

Posted on the users mailing list.