Re: Interpreter Mod We Can All Get Behind
- Posted by CChris <christian.cuvier at ?griculture.go?v.fr> Nov 22, 2007
- 599 views
Pete Lomax wrote: > > Btw, what is the deal with newlines in a triple quote? > One thing I would probably use it for is help/messagebox text, which is always > a right pain with the " and \n"& requirements, especially if they break your > stride/concentration when explaining something difficult. > In this case, I would want the newlines, is this what others expect? > Eg > """ > one > two > three > """ > is "one\ntwo\nthree\n" not "one two three". > That's what I expect from a "verbatim string". Exactly what <pre>...</pre> does in HTML. I didn't fully understand Gary's point about text substitution, very likely because I don't speak Perl. > Gary Shingles wrote: > > > > The other option I liked was the one Derek mentioned from D, automatically > > concatenating sequential character strings. > > I have a couple of problems with that. > 1) It is no easier to convert: > > The quick brown fox > jumped over the lazy dog > > to: > > "The quick brown fox " > "jumped over the lazy dog" > > than it is to convert it to: > > "The quick brown fox "& > "jumped over the lazy dog" > > Obviously it gets messier when you've got dozens or hundreds of lines. > Conversely, to triple quote is +6 chars total no matter how many lines. > > 2) If you write, say > }}} <eucode> > constant words = {"ONE", > "TWO", > "THREE" > "FOUR", > "FIVE"} > </eucode> {{{ > then words[4] will be "FIVE". If anything, I'd prefer it to treat a missing > comma as if it had found one. > Agreed. > Regards, > Pete