Forum OpenACS Q&A: Re: Additions to the tcl language

Collapse
Posted by Tony Kirkham on
Thanks for the comments and feedback.

This change is not changing existing behavior. It is adding behavior in the form of a new sub command which amounts to a more succinct way to express something than what currently exists.

So instead of writing things like (which is suggested above)
set a [expr {[dict exists dict_val key] ? [dict get dict_val key] : ""}]
-or-
if { [dict exists dict_val key] && [dict get dict_val key] ne "" } ...

we could write
set a [dict getnull dict_val key]
-or-
if { [dict getnull dict_val key] ne "" } ...

I am considering adding it to my systems and wondered if the community would find value in it and where it made the most sense to place something like this.

-Tony