Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Javascript Boolean

Name: Anonymous 2016-09-30 21:51

The Boolean object is an object wrapper for a boolean value.

Syntax

new Boolean([value])

Parameters

value
Optional. The initial value of the Boolean object.

Any object whose value is not undefined or null, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement. For example, the condition in the following if statement evaluates to true:

var x = new Boolean("false");
if (x) {
// this code is executed
}


https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean

Name: Anonymous 2016-10-07 18:19

>>21
Oh, you must mean the Void type which is uninhabited. But that's not the problem here. The problem is to prevent a null value from inhabiting every fucking type. Because the way it's done in LITHP, there is a possibility of nil in every fucking value. You're writing a function? You've got to check every fucking argument to see if it's null. Your call tree has n levels? There will be n fucking nil checks for every fucking value because no function can be sure that the arguments it is called with are non-nil. The Common Lisp way is like being an amnesiac retard that checks and re-checks everything all the time because he can't remember what he has checked and what he hasn't.

That's why the null pointer was the billion-dollar mistake. The Right Way is of course to have a distinction at type level between things that might be null and things that are definitely not null.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List