From: Offer K. <off...@gm...> - 2015-01-26 20:33:25
|
On Mon, Jan 26, 2015 at 3:02 AM, John Ousterhout wrote: > (I'll bet none of you thought I actually read these postings anymore, but > sometimes I do!) > Hello Professor. It's an honor to have you answer my question. I'm only sorry I couldn't reply earlier, it's been a crazy day at work. > > So, yes, backslash substitution did occur, but it happened in the list > parser, long after the curly braces had been removed by the command parser. > Ah, this is the key piece of information I was missing. Looking at the various official documentation pages I'm still unsure if I missed it or if it's simply missing from Tcl's docs. Maybe something could be added to the "list" documentation to clarify this? > By the way, when I saw your message my first thought is that backslash > substitution must actually be occurring inside the braces; I had to think > for a bit to remind myself of the real answer above. I will admit that the > multi-level parsing in Tcl can be confusing to people. I think if you managed to explain it to me so clearly in 2 sentences a short addition to the list command documentation should clear it up that confusion for most people - or even prevent it in the first place (the examples in the official documentation are really helpful in that regard by the way!). > It's quite simple and > predictable once you understand it, but it's also quite different from > virtually all other languages, so people don't expect it. People tend to > assume that parsing happens once-and-for-all at a single place and point of > time, but that's not how Tcl works. This feature is actually important for > Tcl's extensibility, since it allows each command to interpret (i.e., parse) > its arguments however it wants, without being constrained by any global > notion of parsing. If Tcl did not have his behavior, it would be difficult > for individual commands to introduce new syntaxes for their arguments. > > -John- Thank you again Professor for taking the time to respond. It's very much appreciated :) Best regards, Offer Kaye |