From: Griffin, B. <bgriffin@Model.com> - 2003-08-06 15:06:40
|
I'd like to throw my (non-counting) vote in in favor of the {expand} syntax. For me the issue comes down to maintainability of the code. I know from experience that this is one area that produces a high number of bugs in our code. It's too easy to get an eval wrong and I believe new, easy to read and explain, syntax will go a long way in improving the reliability of Tcl code. To me it is worth the "cost". -Brian Jacob Levy wrote: > Peter > > Thanks for the reply. So it comes down to: > > * Do we use up the remaining free syntax for a solution that (to Peter and > several others) appears more intuitive than a command. > * --OR-- Do we save the syntax for later uses because there might be cases > where it won't be possible to do something easily with a command. > > My $0.02 is to save the syntax up for later, especially since its possible > to write things with a command. Clearly a command would have to be > designed carefully to maximize the chances that people would get it right > easily and that the code they produce is readable at a glance. > > If forced to choose between {} and {expand} I'd choose {}. Per JO's > invocation of the "Huffman encoding rule", the shortest sequence (in this > case {}) should be the least specific one. If you choose {expand} what is > the meaning of {} ?? > > --JYL > > >>At 05:01 2003-08-06, Jacob Levy wrote: >> >>>I'm still waiting for a case where a command cannot do something that >>>{expand}$ or {}$ can do. If there is none then it is not justified to >>>spend any of the very few remaining free syntactical constructions on >>>something that can equally well be achieved with a command. >> >>Simple answer: there is nothing the syntax can do that a command cannot >>do. That is in terms of functionality, efficiency, object-safety and >>such. >> >>IMO, the difference is in writability and readability. >> >>Syntax gains writability from that you mark a word to expand at the >>word. Not in e.g. an index list. >> >>Readability from the same thing plus that the main command that informs >>the reader what the line actually do is first in the line and not >>obscured by a preceding expand command. >> >>Compare these two: >> >>destroy {expand}[winfo children .] >>button .b {expand}$stdargs -text $mytext -bd $border >>exec $prog {expand}$opts1 {expand}[getMoreopts] $file1 $file2 >> >>expand end destroy [winfo children .] >>expand 2 button .b $stdargs -text $mytext -bd $border >>expand {2 3} exec $prog $opts1 [getMoreopts] $file1 $file2 >> >>To me, the difference in readability is huge. >> >>/Peter >> >> >> >>------------------------------------------------------- >>This SF.Net email sponsored by: Free pre-built ASP.NET sites including >>Data Reports, E-commerce, Portals, and Forums are available now. >>Download today and enter to win an XBOX or Visual Studio .NET. >>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 >>_______________________________________________ >>Tcl-Core mailing list >>Tcl...@li... >>https://lists.sourceforge.net/lists/listinfo/tcl-core > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Tcl-Core mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-core > -- ------------------------------------------------------------- -- Model Technology Inc. -- -- 8005 SW Boeckman Road 503.685.7000 tel -- -- Wilsonville, OR 97070 USA 503.685.0921 fax -- ------------------------------------------------------------- -- Technical support ............ mailto:su...@mo... -- -- Sales and marketing info ....... mailto:sa...@mo... -- -- Licensing .................... mailto:li...@mo... -- -- Home Page ........................ http://www.model.com -- -- AIM ........................................ bgriffin42 -- ------------------------------------------------------------- |