by codezero · 12y ago · 0 comments
An example from his own github repo:
dcurrent = heap.Pop(n).(*D_Node)
So if you are using multiple types, you need to keep track of that, or do more boilerplate in a type switch to pull out what you want, or use reflection, so it's really not quite as elegant as it may seem.For languages like Go you look at static types from 2 sides - 1) it is there for safety and reliability (so in this case if it couldn't be circumvented it would that way) or 2) it is there to speed things up. Then Go is like a faster Python but casting things left and right erasing types will make the code blow up.
So taking the second approach, I don't see it as terribly. But maybe someone coming from Java or Haskell might be really offended by that line of code.