[plt-scheme] slatex and including unit testable code

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed May 16 09:55:43 EDT 2007

Well, you probably wouldn't need to hack the parser to go that route.
You can use read-syntax to get a version of the file as a value that
has the source locations in it and then reconstruct things from there.
Not trivial, but at least you can rely on the manuals for help :)


On 5/16/07, Grant Rettke <grettke at acm.org> wrote:
> On 5/16/07, Robby Findler <robby at cs.uchicago.edu> wrote:
> > On 5/15/07, Grant Rettke <grettke at acm.org> wrote:
> > > On 5/15/07, Robby Findler <robby at cs.uchicago.edu> wrote:
> > > > Slatex lets you include code directly from a file, but I find that I
> > > > often end up writing scripts that chop up my Scheme file in order to
> > > > insert it into a slatex document.
> > >
> > > How do you go about chopping up your files, by line number range, or
> > > procedure name?
> > >
> >
> > Depends, but a way that works well is to have a comment that says
> > "START CHOPPING HERE" and another one that says "STOP". Usually, I'll
> > put a filename into the first comment. To read them out, I use regexp
> > matchign directly on the port.
> >
> > Its a hack, but sometimes useful.
> That hack sounds like it may be a better use of time than hacking the
> parser to be able to extract definitions by name, though!

Posted on the users mailing list.