From: Peter S. <pet...@sp...> - 2003-01-28 23:17:17
|
>I wonder if I could bounce another idea off you, that >perhaps the expand command could use {WORD} >"syntax" to indicate which elements are *not* expanded. > >Instead of: > >expand { button .b @$stdargs -text $mytext -bd $border } > >One could write: > >expand { button .b $stdargs -text {$mytext} -bd {$border} } > >This would indicate that $mytext and $border should be >passed directly as objects instead of being expanded as lists. >The $stdargs list would be expanded inline, and the other >values would be left alone since they are already single words. > >What do you think of this approach? It's an interesting idea, and perfectly doable, but I don't like it for a couple of reasons. First, that is marks the ones that should not be expanded. When I write a code line that needs argument expansion, it is the thing to expand that is in my thoughts. Having to reverse that thinking and start marking everything else, and thinking of what needs marking and what doesn't, takes more effort. It is also more error prone than the direct mapping from my intention to the code that I can get by marking what should be expanded. Second, it uses an established syntax, braces, for something that does not mean the same thing. It sits rather deep in my mind that braces mean "do not substitute", and suddenly it means "substitute but do not expand". I see some confusion waiting to happen there. Third, I have not given up hope for a global syntax yet. Since this could not possibly be a global syntax this is not an alternative until that road is closed. Actually, the second and third are not nearly as important as the first, so: Fourth to tenth, see first. :-) /Peter |