LukeShu
Joined 15 years ago
Joined 15 years ago
I promise you I won't give a shit about the unsubsidized price.
close() on a chan is "indicate end-of-transmission"; you should only ever use it from the send end. There is no way to explicitly "close" the receive end.
You can use `select` to do a non-blocking sends/receives, but yeah normal sends/receives are blocking.
$0.80 in bulk. Around $1.25 for individual quantities, depending on who your reseller is.
AIUI, the CPU cores are a small fraction of the die area compared to all the peripherals on the chip.
But yes, framing TCO as an optimization is unfortunate.
type IntBox struct { v int }
type StrBox struct { v string }
func (b IntBox) MapToStr(f func(int) string) StrBox {
return StrBox{v: f(b.v)}
}
(Please forgive any typos I made on mobile.)It wasn't a great example because "Box" isn't really a useful type. But the point is that you no longer need to define a separate "MapToXXX" method for every type you might want to map to; now you can have just one type-generic "Map" method.
I mean that's also Git's style of development.
[ my public key: https://keybase.io/lukeshu; my proof: https://keybase.io/lukeshu/sigs/HnTgaX1Qhui0yhjc6P-GRCJqUfJlk_xU09_TFpQKk0U ]