logoalt Hacker News

bmachoyesterday at 12:48 PM1 replyview on HN

Tcl has these types as well. They are special strings.

Number: string of digits. List: strings separated by space. Dictionary: key value pairs in a list.


Replies

IshKebabyesterday at 8:40 PM

No they aren't. Everything is a string. The runtime does some optimisation where it actually does use different types under the hood but they don't change the semantics.

If you try to pass a list into a function expecting a string it will just treat the list as a string. No type error or anything, not even at runtime.

CMake is the same. Terrible design. Real types are useful.