Thank you Roger, it is kind of funny how natural that syntax is that couple people use it so naturally.
But with all of these ... it is impossible to squeeze them into Go (even 2) without breaking backward compatibility. Unless we will add something that will take nil from pointers, something like func f() (v interface{} | !nil) { ... // this function never returns nil } Or... adding "require" to package statement to indicate Go 2 is the language for this file package main requires "go2" or just package main "go2" on top of the file. Or new extension "go2" for the files ... or identify it in go.mod... But anyway - if we want the new "pointer | nil" to be expressed as is, some rather big changes will be needed, and I do not see it ever happening without forking the language. Yes, I am that pessimistic On Sunday, July 14, 2019 at 12:53:52 AM UTC-6, rog wrote: > > On Fri, 12 Jul 2019, 07:22 Sam Whited, <s...@samwhited.com <javascript:>> > wrote: > >> >> >> On July 12, 2019 4:35:54 AM UTC, Andrey Tcherepanov < >> xnow4f...@sneakemail.com <javascript:>> wrote: >> >What these guys are proposing in that paper would be closer to >> >(Go-style) >> >func f() (v value | e error) { ... } >> > >> >(where "|" could be read as "or" or "union") >> > >> >> I've thought a tiny bit about how union or sum types would work in Go >> using a similar syntax. My initial thoughts are here in case this is of >> interest to anyone else: >> >> https://blog.samwhited.com/2019/06/go-and-sum-types/ > > > As far as I can tell, that's almost identical to the scheme that I > suggested here: > https://github.com/golang/go/issues/19412#issuecomment-288485048 > > >> >> —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 golan...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/2858C8AA-F25B-4415-A8D4-753DA679EC27%40samwhited.com >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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/5f537183-0fb6-47e0-8a2e-844b540e1014%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.