Absence & nothing

None, one kind of nothing

JavaScript hands you two kinds of nothing — null and undefined — and a lifetime of guessing which one you’ve got. Ascent has exactly one: None.

The catch: a value can only be None if its type admits it. A plain String is always a real string, so trying to make one absent stops you cold:

You’ll see it the moment you type it — None isn’t a String — and Run stays greyed out until it’s gone.

To let a slot hold a string or nothing, you mark the type with a ?String? — which is the whole of the next screen. Once a type admits absence, None is just an ordinary value you compare against:

True. No magic hole, no second kind of nothing — absence is a real, named value, and the type always tells you whether it’s even possible.