Comment

Comment by AQXt

> What thing that violates a type check would be "perfectly fine to do"?

A typical example, in dynamic programming languages, is to treat numbers as strings and vice-versa; evaluate lists in boolean context; and so on.

> If value is not a numeric type, square is not going to be happy. And that's the case with most (all?) dynamic code.

Some programming languages will be glad to accept a string and treat it as a number -- see Duck Typing (https://en.wikipedia.org/wiki/Duck_typing).

parent AQXt 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton