On 23-7-2009 11:01, Invisible wrote:
>
> In other words, the type system is an artiface invented to turn an
> undecidable problem into a decidable one.
>
> For example:
>
> 5 + (if 1 == 1 then 0 else "yellow")
>
> This is type-safe (it produces the answer 5), but most type systems
> would reject this as ill-typed.
I think there are even languages that would promote the 5 to a string to
be able to do a string concatenation if you had chosen another boolean
expression that was false.
Post a reply to this message
|