Your work on porting *reposurgeon* (from Python into Go) for improved performance sounds very cool, Eric (BTW, your work in, and musings on, Lisp and UNIX have been a huge influence on my evolution as a programmer. Kudos for that!
On Thursday, August 30, 2018 at 11:56:58 AM UTC-5, Eric Raymond wrote: > > I apologize if this seems like an elementary question, but web searches > and reading the Go documentation is not turning up an answer. > > I'm in the process of translating reposurgeon, an editor for > version-control histories, from Python into Go for improved performance, > .The central data structure is Repository, which consists mainly of a list > of events such as commits and tags. In Python, I use the language's late > binding and simply declare a list of containing multiple object types named > Commit, Tag, etc. There are also a number of lookup maps pointing at > objects in the main event list. Because objects in Pytron are passed by > reference everything is fairly straightforward. > > I'm trying to translate this to Go in a type-safe way. To do this, I need > to be able to write two declarations: "Slice of pointers to objects > satisfying the Event interface" and "map of string keys to pointers to > objects satisfying the Event interface". My attempts so far have yielded > very cryptic error messages and no success. > > Is it actually possible to restrict the main list's polymorphism in this > way and avoid casts? > > > > > > > > -- 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. For more options, visit https://groups.google.com/d/optout.