On Thu, Dec 11, 2014 at 10:52 AM, Eric Snow <[email protected]> wrote: > > Cool. So generics via macros? >
Well, I intentionally didn't specify generics. Yes, that is a use-case. But from what I gather, go generate is intended to be used once when first writing code, not every time you compile. So it's more like another tool than a language feature: you use the tool to remove the tedium/errors from copy/pasting. So to continue the Set example, if you were implementing a new type and you wanted to use it with Sets, you'd reach for two tools: go generate, and a library which generates a Set type specific to another type. It generates new source code which gives you this functionality. It's much more intentful than generics in that you have to make a decision to generate code. Also, while I think this will mostly be used to parse/generate Go code, it's also not limited to that. Rob Pike gives yacc as an example of where this might also be useful. > Nice. This would be good for our various testing sub-packages, among > other things. > Good point, I hadn't thought of that.
-- Juju-dev mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
