I'm looking for advice on how to implement, in Common Lisp, the
sweet-expression semantics for {backquote,comma,comma-at}+whitespace.
The "obvious" way is to re-implement these capabilities; Steele's 2nd edition
appendix C
gives public domain code to do this:
http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node367.html
This seems a little error-prone, and it won't take advantage of whatever
simplifications exist in the underlying CL implementation. In general, CL
handles this stuff in non-portable ways, and a re-implementation won't "work
the same way".
It'd be nice to invoke the "actual" backquote or comma/comma-at, but if I do,
they will invoke "read". Yet I need to regain control of the reader, and pass
that reader the indentation level ... preferably in a thread-safe way.
Basically, historically "read" didn't care about indentation levels.. but any
indentation processing system will. One way to do that is to set a special
variable (!!) with the indent level, and use the readtable that already
redirects all chars. The readtable would redirect to a procedure that, if the
special variable indent is set, invoke the sweet-reader with that indent level.
Am I missing a simpler alternative to implement the intended semantic?
--- David A. Wheeler
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss