Quoting Ian Lance Taylor (2018-10-16 09:44:00) > It's not clear to me what other aspects of various generic proposals > you are picking up here. How are you imagining that we would write > the function that merges two channels? With the current design draft > that looks something like this: > > ... > > Also, how do you write the graph example from the design draft, which > uses two types? > > Ian
Through this discussion I'd been mentally grafting Eric's operator solution to my own proposal, which uses interfaces instead of contracts and just punts on operators entirely (due to the fiddly issue I brought up re: pointers, which I hadn't come up with a solution for): https://gist.github.com/zenhack/ad508d08c72fce6df945a49945ad826d The graph example is the more interesting one, here's a direct link to that solution: https://gist.github.com/zenhack/ad508d08c72fce6df945a49945ad826d#mutually-referential-type-parameters The channel example is the same as in the current draft; it doesn't use contracts as-is, so is unaffected by either my own design or Eric's.20 I think Eric's solution is mostly orthogonal to what I discuss in the above design, but solves the most unsatisfying things. I may try to actually write up a version that incorporates it sometime next week. -Ian -- 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. For more options, visit https://groups.google.com/d/optout.