On 2/17/24 1:32 AM, Axel Wagner wrote:
On Sat, Feb 17, 2024 at 2:09 AM Sam Vilain <s...@vilain.net> wrote:

    I would argue that the matter can be simply decided by choosing
    the /calling/ stack, not the destination stack.

I agree that this is *one choice*. But the point is, that *sometimes* you'd want one and *sometimes* the other. And no matter which choice you make for the language - it means that if the programmers wanted the other, they'd have to jump through annoying hoops and get confusing and hard to debug problems. So if you want to justify either choice, you have to make an argument that it is so overwhelmingly more common what people would want, that the cost of running into these problems is small enough to be justified by the benefit.

I think that's a hard case to make.

Alex, I agree that there are cases where you might prefer one versus the other.  However, you cut out the part of my reply where I pointed out it was possible to choose semantics by either returning a closure (context is the source stack) or a bound method (context is the destination stack).  Both of these values can be used interchangeably, as they have the same type, func ..., and so the caller does not need to care whether the function they are calling uses the calling context or the original context.  Were you not convinced by the argument?

Sam

--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d9dd7d6a-cbad-47c2-84be-5a64b637c9e5%40vilain.net.

Reply via email to