From: Timothy J. H. <ti...@cs...> - 2004-06-23 13:29:10
|
On Jun 23, 2004, at 8:59 AM, Ken Anderson wrote: > http://www.unknownlamer.org/code/guile-web-manual.html > > Guile uses #- ... -# as their quasi string approach. Interesting. But their quasi-string doesn't allow escaping into Scheme in the middle. It seems to be just for quoting long sections of text (like Pythons triple quote """.....""") They can get something similar to full quasi-strings though using string- append, or flatten-and-string-append: (flatten-and-string-append #- <html> <head><title> -# title #- </title></head> <body bgcolor="-# color #-"> <h1>Cool, a -# color #- page</h1> </body> </html> -#) which is equivalent to our approach: #{<html> <head><title> #[ title ]# </title></head> <body bgcolor="#[ color ]#"> <h1>Cool, a #[ color ]# page</h1> </body> </html> }# Our-variant on their approach (not escaping into Scheme) would be (!{} #-{<html> <head><title>}-# title #{ </title></head> <body bgcolor="}# color #{"> <h1>Cool, a }# color #{ page</h1> </body> </html> }#) This makes it a little more clear locally what is a string and what is Scheme and uses our built-in operator !{} == flatten-and-string-append Maybe we should add guile-style quasi-strings to JScheme. It would be easy and the guile approach does have a certain elegance! --Tim--- |