In business apps, the need for default values happen all the time, so the idiom has value (not sure for the message name though).We could use��
x := [ self thing ] ifError: [ someDefault ]��
for these purposes. Triggering errors is not too nice still.
Now, what if self itself is nil or empty?
BTW, isEmptyOrNil exists in the image for Collections and UndefinedObject. Empty has no meaning for Object, so why test against empty in the name?
In the image, I see that we do have #default: anObject in several places. It seems to serve the same intent.
What is the idiom for such things in Pharo? Importing idioms from other languages works but if we do have one already, we will introduce confusion.
Phil