> (0) I'm not feeling the itch for verbatim strings, seeing as clojure > already does multi-line literals (with escaping) and has special > syntax for regex patterns.
That's unfortunate, as I think it would be an important addition to the language. I didn't know Clojure's #"" doesn't require extra escaping (after some searching I was happy to discover this was because Chouser did a great job lobbying for it: http://tr.im/BFCT), and that's great news, but verbatim strings are still useful. If you're going to be writing a website and want to put some HTML into your source for example, it's essential, or if you have a reason to put any other document into your source, for example if you're writing a command line tool and want to provide some great information in your --help. While you may not feel the itch now, could you see how there are situations you could find yourself in where it would be useful? > (1) If it's all the same to everyone else, just use python's > triple-quotes. In practice, they work well enough, but if we're using > them for verbatim strings there still wouldn't be a way to embed, e.g. > a code fragment demonstrating use of a raw string in a a raw string. > Is this so terrible? No, I personally have no real issue with triple-quotes, it's the same number of characters as #s{. The only thing some might object to is how it's not "clojurey". #s { .. } fits with Clojure's other syntax structures. > (2) Perlish/Sedish choose-your-own-quote has always struck me as an > ugly hack. More important though are worries about making tooling more > complicated: > > How much more complex would this make, e.g. correct syntax > highlighting in emacs, in eclipse? I think you make an excellent point here. I also agree with you, the Perl "make your own thing up" path, while it has some advantages, it will lead to everyone having their own special convention (leading to confusion when reading code) and it will make life difficult for source highlighters, and the people who write them. - Greg On Oct 13, 2009, at 3:29 AM, B Smith-Mannschott wrote: > > On Mon, Oct 12, 2009 at 01:31, James Reeves <weavejes...@googlemail.com > > wrote: >> >> What if you need to use braces? It seems to me that any syntax for >> representing long strings needs a terminator that is unlikely to >> occur >> within the string itself. For example, Python uses """, and XML CDATA >> uses ]]>, both of which are character sequences unlikely to turn up >> in >> a string. By contrast, an ending brace } is not rare enough to be >> used >> as a terminator, IMO. > > Yes, please. I'd like to pile on here with a few ideas and questions > > (0) I'm not feeling the itch for verbatim strings, seeing as clojure > already does multi-line literals (with escaping) and has special > syntax for regex patterns. > > (1) If it's all the same to everyone else, just use python's > triple-quotes. In practice, they work well enough, but if we're using > them for verbatim strings there still wouldn't be a way to embed, e.g. > a code fragment demonstrating use of a raw string in a a raw string. > Is this so terrible? > > (2) Perlish/Sedish choose-your-own-quote has always struck me as an > ugly hack. More important though are worries about making tooling more > complicated: > > How much more complex would this make, e.g. correct syntax > highlighting in emacs, in eclipse? > What about tools that wish to read clojure code as data but are not > themselves clojure? We wouldn't be doing them any favors by > unnecessarily complicating the surface syntax. > > (3) Perhaps something akin to Lua's approach (mentioned previously in > this thread) could address the limitations of (1) without the uglyness > of (2). > > Just my 2c > Ben > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---