Hacker News new | ask | show | jobs
by skybrian 1949 days ago
What happens if you call a Tcl function with an undef argument? Is this running Tcl code on a slightly different runtime, or do they interop in some other way?
1 comments

In Tcl, everything is a string. The string rep of undef is "" so Tcl gets "" but doesn't know that it is undef.

So yeah, there is some sloppiness there. Tcl tends to use "" as sort of a null or undef so lots of stuff just works but no promises on that.

This is sloppy simply because the Tcl die hards (are there any left?) refused to see the value of undef, a value for a variable that said there is no value. We used it all over the place, there clearly is value. They didn't see that, Little never got pushed back into the Tcl source base so Tcl never thought about undef.

It is what it is, we live in an imperfect world. I tried.