Hacker News new | ask | show | jobs
by chairhairair 507 days ago
It could be:

foo ?! { bar }

But, now we’re potentially confusing the “negation” and the “exclamation” meanings the bang symbol usually tries to communicate.

1 comments

I tend to agree that ? looks like "if then" when what we really want is some sort of coalescing, or "if not then".

foo ?? { bar }

foo ?/ { bar }

foo ?: { bar }

foo ?> { bar }

foo ||> { bar }

Im not sure I like the idea at all though. It seems like a hack around a pretty explicit design choice. Although I do tend to agree the error handling boilerplate is kind of annoying.