The Nullable type is needed to fix Tony Hoare's "billion dollar mistake".
But implementing the idea is full of pitfalls, e.g., Null by itself should not be an expression.
▮ is the terminator to mark the end of a top level construct.
An Expression◅aType▻ is an expression which when executed returns aType.
In an expression,
1. ⦾ followed by an expression for a nullable returns the Actor in the nullable or
throws an exception iff it is null.
2. Nullable followed by an expression for an Actors returns a nullable with the Actor.
3. Null followed by aType returns a Nullable◅aType▻.
4. ⦾? followed by an expression for a nullable returns True iff it is not null.
Illustrations:
* 3▮ is equivalent to ⦾Nullable 3▮
* ⦾Null Integer▮ throws an exception
* True▮ is equivalent to ⦾?Nullable 3▮
* False▮ is equivalent to ⦾?Null Integer▮
In a pattern:
1. ⦾ followed by a pattern matches a Nullable◅aType▻ iff
it is non-null and the Actor it contains matches the pattern.
2. ⦾Null matches a Nullable◅aType▻ iff it is null
Illustrations:
* The pattern ⦾x matches Nullable 3 , binding x to 3
* The pattern ⦾Null matches NullInteger
Edited for clarity
Recent comments
20 hours 24 min ago
1 day 17 hours ago
2 days 21 hours ago
2 days 22 hours ago
1 week 23 hours ago
1 week 23 hours ago
1 week 23 hours ago
4 weeks 1 day ago
4 weeks 6 days ago
5 weeks 5 hours ago