[gambit-list] Reacquainting myself

Marc Feeley feeley at iro.umontreal.ca
Sat Jun 4 18:44:57 EDT 2011


On 2011-06-04, at 4:20 PM, Hendrik Boom wrote:

> New to Gambit, old to Scheme and Lisp (bit I've been away from 
> actively using them for decades, and much has changed).
> 
> I'm refamiliarising myself, taking a small project that I could write in 
> several other languages in an hour, but doing it as learning project 
> instead of a quickie implementation, finding out what's available 
> nowadays.
> 
> The project is to take some overly dictatorial HTML and liberate it.  
> You know the kind of thing, take out all the excess <br>'s and &nbsp.'s, 
> figure out the real structure they're hiding, and reemit it using <p> 
> and <h5> and other proper tags.
> 
> Now I can do all this from scratch, reading characters from ports and 
> writing code to lex it and parse it and recognise idioms and such ... 
> but that's so nose-to-the-grindstone.
> 
> Isn't the whole point of these new Scheme systems that we can work at a 
> more conceptual level?
> 
> So I ask.  What tools and libraries are already there to make this kind 
> of task easier?  Or more elaborate tasks of this kind -- because I will 
> run into them later.  I look in the web and find myself lost in beginner 
> documentation.  I guess I'm looking for links to heavier stuff.
> 
> -- hendrik

If you want to parse HTML in Scheme, let me recommend htmlprag (http://www.neilvandyke.org/htmlprag/) which is very portable.

If you want to generate a lexer or parser yourself, check out Silex and LALR-SCM (Scheme equivalents of lex and yacc), which were developed at the University of Montreal by Danny Dubé and Dominique Boucher respectively (http://www.iro.umontreal.ca/~dube/ and http://code.google.com/p/lalr-scm/).

Marc




More information about the Gambit-list mailing list