3 ms·
This snippet from the implementation sheds some light on the origins of Go for me, the mindset from which it's born and why it isn't a language for me. int
by xixixao 12y ago
This snippet from the implementation sheds some light on the origins of Go for me, the mindset from which it's born and why it isn't a language for me.
interactive := false
if name == "-" {
interactive = true
fd = os.Stdin
} else {
interactive = false
fd, err = os.Open(name)
}
Or do you think I am reading into it too much?
- xtacy 12y agoCould you explain why that snippet makes you decide that way?
- throwaway_99837 12y agoPseudocode (better). Notice the immutable everything and the brevity (i.e., vertical space saved). interactive := (name == "-") fd, err := interactive ? (os.Stdin, None) : os.Open(name) [And yes I understand that Go probably doesn't have tuple literals or a concept of 'None'].