4 ms·
Perl does the same, by the way. A scalar variable can contain both a string and an integer representation. But as always, Perl takes the joke too far, by allow
by majewsky 9y ago
Perl does the same, by the way. A scalar variable can contain both a string and an integer representation.
But as always, Perl takes the joke too far, by allowing variables to have incompatible string and integer representations simultaneously ("dual variables" in Perlspeak). For example, the variable $! is equivalent to C's `errno` when evaluated as an integer, but equivalent to `strerror(errno)` when evaluated as a string.