Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

With void-returning methods and null-punning you can end up skipping critical side effects, which are more common in idiomatic Java than in idiomatic Clojure. C# tries to make this explicit for the receiver with its Elvis operator and nullable reference types.

    foo?.Bar(baz);
and

   var result = foo?.Bar(baz);
both do what's expected: skip the method call and return null (or void) if the receiver is null, and the compiler complains if you don't do that when foo is inferred to be nullable.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: