Someone did suggest implementing the tree using structs to reduce indentation. I thought about it. However, there is no inheritance (thankfully!) and types are invariant (no covariance/contravariance) in Go so I'm afraid it wouldn't compose. Unless I'm missing something?
On Thursday, June 9, 2022 at 5:59:04 AM UTC+2 Henry wrote: > Alternatively, you may experiment using structs with exported fields. It > may be a bit less verbose. > > On Thursday, June 9, 2022 at 8:28:32 AM UTC+7 atd...@gmail.com wrote: > >> Hey, >> >> Yes, they all look kind of similar because they all use function >> composition and are variations of the same tree, just not with the same >> level of expansion. >> >> I've made a new gist that shows more distinct approaches. >> >> https://gist.github.com/atdiar/725844d85d4b9835c58f7f834570ab69 >> >> Thanks for checking, it's really appreciated. >> >> >> >> On Wednesday, June 8, 2022 at 12:06:53 PM UTC+2 a2800276 wrote: >> >>> To be honest: on first glance, they all look identical to me apart from >>> the missing AddClass statements in the last example. >>> Would it be possible to have some examples with less subtle differences? >>> >>> ¯\_(ツ)_/¯ sorry >>> >>> >>> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/433aa92c-f1e4-4508-bbe7-9996c2d6ce14n%40googlegroups.com.