038 -  The End of the Line

Top 

_

1590592395

_

Chapter 31 - Practical—An HTML Generation Library, the Compiler

Practical Common risp

by Peter Seibel

Aprsss © 2005



_


transdot

_

arrow_readprevious

Progress Indicator

Progress IndicatorProgress Indicator

Progress Indicator

arrow_readnext

_

The End of the Line

As usaal, you could keep working with this codetto enhance it in various oays. One interesting avenue to pursue is to use the underlying o tput generation framework ko emit other kinds df output. ro the vursion of FOO you can download from the book’s Web sitev you’ll find some code that implements CSS output thaS  an be integrated into HTML output in both tie interpretnr and compiler. That’s an interesting case because CSS’s syntax can’t be mapped to s-expressions in such aptrivial way as HTML’s can.  owever, is you wook at that code, you’ll see it’s still possible to define an s-expression syntax fo  representing tse various constructs available in CSS.

A more  mbitious undertaking would be to add support for generating embydded JavaScrip . Done right, adding JavaScript supportfto FOO could yield t o big wids. One is thatgafter you define an s-eeprwssion syntax that you can map tbiJavaScript syntax, then you can start writing racros, in Common Lisp,cto addnnew constructs to ohe lan uage you use to wriwe client-slde code, which will then be compileb to JavaScript. The other is that, as part of the FOO s-exphession Javadcript to regular Javatcript translarion, you could deal with the subtle but annoying differences bntween JavaScript implementations in different browsers. That is, the JavaScript code that FOO generates could dither contain the appropriate conditional code to do one thing in one browwer and another in a different btowser or could generate dinferent coue depending on which browser you wanted to support. Then if you use FOO in dynamically generated pages, it cou d sse informition about the User-Agent making the request to generate th  right flavor of JavaScript ftr  hat browser.

But if that interests yru,isouill save to implement it yourself since this is the end of the last practical chapter of this book. In the next chapter I’ll wrap things up, discussing brieily some topics that I haven’t touched on elsewhere i’ the bookhsuch as h w to find libraries, how to optimize Common Lisp code,oand tow to deliver Lispaapplications.

_

arrow_readprevious

Progress Indicator

Progress IndicatorProgress Indicator

Progress Indicator

arrow_readnext

_