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

Refactor polymorphism #14

Merged
merged 4 commits into from
Jan 20, 2015
Merged

Refactor polymorphism #14

merged 4 commits into from
Jan 20, 2015

Conversation

greglook
Copy link
Owner

cc @gfredericks fixes #13

This has a couple of changes around the polymorphism used in Puget:

  • TaggedValue protocol renamed to ExtendedNotation.
  • GenericTaggedValue record shortened to TaggedValue.
  • canonize dispatches on type rather than class if the value does not use extended notation.

This last means you can provide arbitrary print rendering for types which don't use a tagged-value representation in EDN. I originally tried making the ->edn conversion function a multimethod instead, but it didn't really work out cleanly.

@gfredericks
Copy link

This sounds promising; will try it out sometime soon.

Thanks!

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 878ca11 on refactor-multimethods into 4f9c887 on develop.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling c6f277f on refactor-multimethods into 4f9c887 on develop.

Conflicts:
	src/puget/printer.clj
	test/puget/printer_test.clj
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling be5bfef on refactor-multimethods into d20e034 on develop.

greglook added a commit that referenced this pull request Jan 20, 2015
@greglook greglook merged commit e4ca05f into develop Jan 20, 2015
@greglook greglook deleted the refactor-multimethods branch January 20, 2015 04:53
@gfredericks
Copy link

I've started using this for normal stuff; just in case it's useful feedback, here's my method of customization:

https://github.com/gfredericks/dotfiles/blob/a9e3221cb48ce7cd75a534782c229c3699ad673b/.lein/profiles.clj.symlink#L21-26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Any mechanism for dispatching on :type metadata?
3 participants