Burak Serdar <[email protected]>:
> One other difference between the two is the ability of the "like"
> syntax to use a struct as well as an interface for templates, so you
> can require concrete implementations to have certain fields, instead
> of getter/setters.
I'm puzzled that this is not already possible in interfaces.
In the translation from Python I'm working on, I cave two different
classes, One, VCS, represents an importer/exporter pair for a given
version-control system that speaks the git import stram
format. Another, Extractor, bundles methods for mining data from a
repository by harnessing its native client tools.
Both classes want to be selected by a field "name". It's annoying that
I can't declare an interface that says "has a field 'name'" and instead
have to declare a getter function with no other point besides sliding
around that restriction.
But precisely because this could easily be patched into interfaces,
I think it's not much of an argument for your plan.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
My work is funded by the Internet Civil Engineering Institute: https://icei.org
Please visit their site and donate: the civilization you save might be your own.
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.