try_lock
already exists; it’s called lock
. I just want a more convenient name and I want the name of the new method to be lock
, but that ship has sailed.
try_lock
already exists; it’s called lock
. I just want a more convenient name and I want the name of the new method to be lock
, but that ship has sailed.
Looks like the author missed my main complaint about Rust mutexes, which is that the lock
method returns a Result
. There should be a try_unlock
method for when someone actually wants to handle the rather obscure failure case, and the name lock
should be used for a method that panics on failure but returns a value that doesn’t need to be unwrapped first. I see the current arrangement as being about as sensible as having array subscripting return a Result
to handle the case of a failed bounds check.
You’re asking a stranger in the internet to do a whole lot of work for you.
Clearly they’ve never seen a hagfish.
I didn’t enjoy it much, but I had a headache at the time, and the three other people with me had a blast, so I think it’s probably not bad.
Not really. The left side comes from trying to evaluate the Reimann zeta function at a point outside its domain, and the right side comes from evaluating the analytic continuation of the zeta function at the same point. The deepest truth it reveals is that applying the definition of a function outside its domain can give you nonsense results.
It’s one of those ideas like Scrödinger’s cat or pulling yourself up by your bootstraps, where something that was intended to illustrate an absurdity is instead taken as representing some amazing and unintuitive truth.
It’s not saying the proof is obvious, just that the result is plausible on its face.
Fun fact: a hoodoo is also a kind of rock formation.
This is the flip side of people trying to justify all kinds of obviously incorrect language by saying it’s just the language evolving.
The fact that we’re having this discussion at all kind of proves that either English is losing the distinction, or it was never as clear a distinction as people sometimes make it out to be. Either way I’m fine with it because it doesn’t seem like a very useful distinction to make in everyday language, and you can sidestep it entirely by using a word like toxic instead.
Also there’s plenty of precedent for everyone being wrong about something big, like everything revolving around Earth.
You should check out pictures of the pyramids. Egypt looks like it goes on forever!
The weird part isn’t animals having emotions, it’s when they seem to be expressing them in ways that make sense to us. Everyone who’s had a dog or cat knows they express emotions very differently from us.
Mainsplaining sounds more like a liberal arts degree to me.
B. caapi is called ayahuasca, as well as being an ingredient in the brew with the same name, so the image is not technically wrong.
Historically it was also the art of making precise drawings.
If you’re offended by truth, that sounds like a you problem.
That’s not a gotcha. It’s basically just the definition of an axiom.
Your making some really weird—and wrong—assumptions about me.
I think a better solution would be to add a method called something like ulock that does a combined lock and unwrap.
My concern with lock+unwrap is only partly because of convenience; I also didn’t like it because I think it’s a bad idea to get people used to casually calling unwrap, because it tends to hide inadequate error handing.
Now that I think about it, I don’t like how unwrap can signal either “I know this can’t fail”, “the possible error states are too rare to care about” or “I can’t be bothered with real error handing right now”. In one or two of those cases you want to leave it in my production code, and in the last you want to audit all instances and replace them with proper error handing. Using the same function for all three cases makes that difficult.