On Thu, Mar 24, 2022 at 3:23 AM Brian Candler <b.cand...@pobox.com> wrote: > > The OP hasn't said specifically which language or feature they're comparing > with, but I wonder if they're asking for a pointer type which is never > allowed to be nil, enforced at compile time. If so, a normal > pointer-which-may-be-nil would have to be represented as a Maybe[*T] or union > { *T | nil }. To use such a pointer value at runtime you'd have to > deconstruct it via a case statement or similar, with separate branches for > where the value is nil or not-nil. I am sure there have been proposals along > those lines floated here before.
Some proposals in this space: https://go.dev/issue/30177 https://go.dev/issue/33078 https://go.dev/issue/42847 https://go.dev/issue/49202 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUQRvnHCDN0dkuJfG%3DJKdqXeXU00EKrBenr4PVXkiPXSw%40mail.gmail.com.