| ▲ | embedding-shape 4 hours ago | |
> I never understood why Rust didn't / couldn't make functions able to return different outputs depending on context Referential transparency probably being the first reason I could see. Having the behaviour of a callee sounds horrible and something we usually try to actively work against, you want to be able to look at the function in isolation and be able to understand how it works and what values it gives back, without jumping around and seeing where it's being called. And yes, I'd agree with your last part, you do sound a bit like a psychopath ;) With that said, the world needs those too, so I hope your experiment is fun and brings you lots of learnings, enjoy! :) | ||