On Fri, Dec 17, 2010 at 7:06 AM, Peter Stuge <pe...@stuge.se> wrote:
> Øyvind Harboe wrote:
>> Which is better? (whatever "better" is)
>>
>> This:
>>
>> if {[info exists CHIPNAME]} {
>>    set  _CHIPNAME $CHIPNAME
>> } else {
>>    set  _CHIPNAME at91r40008
>> }
>
> All these blocks in the target files have really annoyed me.
>
>
>> or this:
>>
>> set _CHIPNAME [defaultval $CHIPNAME at91r40008]
>
> Significantly better.

It's trivial to do something shorter, like:

defaultval CHIPNAME at91r40008

The advantage of the more verbose syntax is that it
is more self documenting:

set _CHIPNAME [defaultval $CHIPNAME at91r40008]

Any preference?

-- 
Ø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

Reply via email to