8 ms·
In Tcl there is an idiom to do things like some_func $value[set value “”] where the [set value “”] bit reduces the refcount. There’s also a fairly widespr
by nmadden 2y ago
In Tcl there is an idiom to do things like
some_func $value[set value “”]
where the [set value “”] bit reduces the refcount. There’s also a fairly widespread idiom of using the K combinator for this[1]:
some_func [K $value [set value “”]]
It’s one of those things that has become second-nature to people in-the-know, but is a total headscratcher otherwise.
[1]: https://wiki.tcl-lang.org/page/K#c2a6014c2d129837889d8a8000d05e5c3b44e8f6b46cab777c04df8a927bfad2 https://wiki.tcl-lang.org/page/K#c2a6014c2d129837889d8a8000d...