News for hackers. Stuff that matters.
Re:The Tcl Programming Language: A Comprehensive Guide (2nd ... by remram on Friday April 04, 2025 @11:09PM (#43590326)
What you said above is correct but is not related to what was being discussed before.
Re:The Tcl Programming Language: A Comprehensive Guide (2nd ... by apgwoz on Saturday April 05, 2025 @02:45AM (#43591433)
How is it not related?

Because Python is “strong typed” vs “weak typed” for Tcl?

    $ tclsh8.6
    % expr 1 + 2
    3
    % expr 3 + “hey there”
    invalid bareword “hey”
    in expression “1 + hey there”;
    should be “$hey” or “{hey}” or “hey(…)” or …
vs.

    $ python3.11
    >>> 1 + 2
    3
    >>> 1 + “hey there”
    Traceback (most recent call last):
       File “<stdin>”, line 1, in <module>
    TypeError: unsupported operand type(s) for +: ‘int’ and ‘str’
I don’t really see a difference. Both checked types at runtime. Clearly Tcl can check types at runtime, even though it represents everything as a string. Whether all commands do so is another story. But, not all functions in Python check types before trying to do things that don’t make sense, either. So…
Re:The Tcl Programming Language: A Comprehensive Guide (2nd ... by bombarolo on Saturday April 05, 2025 @11:41AM (#43594303)
I can see a difference that I can understand the Python’s error message, the Tcl’s one not so much.
Re:The Tcl Programming Language: A Comprehensive Guide (2nd ... by apgwoz on Saturday April 05, 2025 @01:28PM (#43595062)
Error message usefulness is not a strict requirement of type systems.