Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add collections.SymDiff #5410

Closed
bep opened this issue Nov 6, 2018 · 7 comments · Fixed by #5411
Closed

Add collections.SymDiff #5410

bep opened this issue Nov 6, 2018 · 7 comments · Fixed by #5411
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Nov 6, 2018

See #5400

Alias: symdiff

@bep bep added the Enhancement label Nov 6, 2018
@bep bep added this to the v0.51 milestone Nov 6, 2018
@bep bep self-assigned this Nov 6, 2018
@kaushalmodi
Copy link
Contributor

bep added a commit to bep/hugo that referenced this issue Nov 6, 2018
@kaushalmodi
Copy link
Contributor

Looking at this, makes me think.. may be you should break it out into a separate Go library for Set Theory. That way it will open it up for more contributions, and you just create aliases for the methods in Hugo.

@bep
Copy link
Member Author

bep commented Nov 6, 2018

Hugo's type handling is, in general, not useful outside of Hugo.

@kaushalmodi
Copy link
Contributor

kaushalmodi commented Nov 6, 2018

Thanks, I was reading the PR in hurry and missed that.

Or.. I think I don't know what I missed. I reread the PR, and it seemed generic enough. Isn't type handling good, usually?

bep added a commit to bep/hugo that referenced this issue Nov 6, 2018
bep added a commit to bep/hugo that referenced this issue Nov 6, 2018
bep added a commit to bep/hugo that referenced this issue Nov 6, 2018
@bep
Copy link
Member Author

bep commented Nov 6, 2018

Isn't type handling good, usually?

That's a very generic statement to have an opinion either way about. Go 2 will probably come with Generics, which may or may not make our lives easier, but there are a couple of reasons why these template funcs works best as ... template funcs:

  • We use reflect so we can take any type (Page, int, string ...) and ... complement it etc. This is, of course, in general useful, but isn't very ... pretty to look at.
  • The way Go template funcs works makes us make these slightly odd APIs (re. yesterdays discussion). That works in templates, but we would do it differently if a pure Go API.
  • And finally, since the different decoder libraries we use (JSON, TOML, YAML) all have their own conception of which types to use for numeric values, we also do some conversion of those etc. which we probably would not care about in a general library.

@kaushalmodi
Copy link
Contributor

Thanks for the detailed explanation; makes sense!

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants