s c h e m e w i k i . o r g

/ WebHome / Sandbox.ScmToXexpr

This Web


WebHome 
WebChanges 
WebTopicList 
WebStatistics 

All Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
TWiki Shorthand

Offsite Links


Schemers.org
Lambda the Ultimate
twiki.org

Scm2Xexpr - Scheme code formatter

Overview

The program listed below converts Scheme source code, stored in a specified file or text string, into PLT's Xexpr representation of XML. This can be used to generate web pages containing formatted Scheme code. The program listing below is generated by a PLT web servlet which uses this code.

About the code

The code was adapted from Dorai Sitaram's TeX2page, with the following changes:

The resulting program is almost purely functional, with the only remaining imperative operation being the incrementing of the variable input-line-no, which is not currently used. The only other mutation involves the use of destructive reverse! for performance, and a once-per-request initialization of the lexical variable current-input.

Scm2Xexpr.scm

Syntax Highlighting: error: scm: undefined language

Pretty.scm

The following is a PLT web servlet which invokes the above code:

Syntax Highlighting: error: scm: undefined language

 
 
© 2004 by the contributing authors. / You are Main.guest