-j
--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
package main
import "fmt"
type( A struct{} B struct{} C struct{} Union struct{ A *A B *B C *C })func main(){ a := &Union{A: &A{}} fmt.Println(a)}I use go/ast package mildly to moderately, but the lack of safety between ast.{Node,Expr,...} etc hasn't been a problem yet.
I'm actually not sure what safety means in this case.
What you are describing fits closest to the concept of a discriminated union
, which I thought was nice in Limbo (pick) but didn't really miss too much after using Go more frequently, and I can see why they weren't included in the language.
I'm actually not sure what safety means in this case.Less opportunity for people to make mistakes that make a program panic.
--
What research or other literature can you recommend on the topic of type theory?