On Fri, Dec 17, 2010 at 5:03 PM, John Hartman (NoICE) <j...@noicedebugger.com> wrote: > ?yvind Harboe wrote: >> Which is better? (whatever "better" is) >> >> This: >> >> if {[info exists CHIPNAME]} { >> set _CHIPNAME $CHIPNAME >> } else { >> set _CHIPNAME at91r40008 >> } >> or this: >> >> set _CHIPNAME [defaultval $CHIPNAME at91r40008] > > As someone who USES OpenOCD but doesn't live and breathe it, I find the "if > then" version easier to read and understand > > Anyone who has used any computer language can figure out what if/then does > (even though we may wonder about the difference between CHIPNAME, _CHIPNAME, > and $CHIPNAME) > > In contrast, since I don't know TCL, I have to puzzle out whether > "defaultval" is a standard proc (as you post says), a language keyword, or > something else. > > In my opinion the if/then version makes it easier for new users to customize > cfg files. And since most users will need to customize at least one cfg > file, I think simplicity trumps short files.
I think you raise important enough points that unless they are addressed, we should keep it as is. Understanding *one* target script should not be made harder. -- Øyvind Harboe Can Zylin Consulting help on your project? US toll free 1-866-980-3434 / International +47 51 63 25 00 http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger and flash programmer _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development