From: Geoffrey K. <ge...@kn...> - 2004-06-23 16:24:25
|
Maybe you could have a Guile compatibility feature, so that users migrating code from Guile to JScheme wouldn't have to worry about the difference in syntax. In the long run, one syntax will probably win out over the other, but it could be a very long time before it's clear what users prefer. If JScheme makes this overture to the Guile community, maybe Guile will reciprocate. Done right, users should be able to pick the syntax they like with minimum pain. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk On Jun 23, 2004, at 10:07, Ken Anderson wrote: > You're right, i didn't look closely enough at the example. > > I thought it was > ;;; output page header > (define (header title) > #- > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> > <head> > <title>#- title -#</title> > </head> > -#) > ) > (header "foobar") > > that is as you nested #-'s you go in and out of string/scheme mode. > But i think it would be confusing to know which level you were at. > > I wouldn't add another quasi string type. I'd make it so people could > add their own # macro characters. > > k > At 09:29 AM 6/23/2004 -0400, Timothy John Hickey wrote: > >> 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--- > > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user > |