Hi,
Null coalesce operator - returns the first not nil operand.
Adding one simple method to an Object:
?? anObject
��^ self
and to UndefinedObject:
?? anObject
��^ anObject
could allow us to write:��
��
default1 := nil.
default2 := nil.
default3 := 'foo'.
default4 := 'don''t care'.
config := default1 ?? default2 ?? default3 ?? default4.
=> 'foo'��
I know you don't like to add new methods to an object, but still :)