Rod Adams skribis 2004-11-29 1:56 (-0600): > Are they really common enough to merit a "two char, absolutely no > whitespace after it" lexical? Especially one that looks a lot like the > left bitshift operator, as well as an ASCII version of a Unicode quoting > and splitting character? > What if instead, we add a different adverb to q// and qq//? something > like :h. That way people can mix and match all the quoting option they > want, and we remove some annoying requirements about when you can and > cannot have /<<\s+/ in your code.
I think this is a very good idea. I too dislike the whitespace disambiguation thing for this, and was going to propose using unary % instead of <<. But this is even better, IMO. > Since < and > are now full class quote-like thingies in P6REs, much to > the chagrin of those of us who parse html on a regular basis, using them > as such in the rest of P6 makes sense as well. It would be great if <''> in a rule would be just ''. rule NotationDecl { <'<!NOTATION'> <S> <Name> <S> [<ExternalID> | <PublicID>] <S>? <'>'> } would then just be rule NotationDecl { '<!NOTATION' <S> <Name> <S> [<ExternalID> | <PublicID>] <S>? '>' } Which I find much easier to read. (Frankly, <'>'> is just too hard to type and be parsed by a human.) It also makes all other balanced delimiter matching rules more readable: rx/ \[ \w+ \] / rx/ <'['> \w+ <']'> / rx/ '[' \w+ ']' / Juerd