Administrator
|
While these are some of the advantages of having 'true' be represented by -1, this is not the reason that true is represented by -1 (though it is almost certainly what motivated the authors to specify this behavior).
The reason is that the VM language specifies that true will be represented by -1. The language could have just as easily specified that it be represented by 1 and, indeed, many languages (include C) do just that.
We need to get in the habit of first and foremost looking at the specified behavior of the language we are working with, especially when writing a translator or compiler for that language.
|