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

Write def (macro?) for Show #100

Open
loicdescotte opened this issue Jan 29, 2018 · 2 comments
Open

Write def (macro?) for Show #100

loicdescotte opened this issue Jan 29, 2018 · 2 comments
Milestone

Comments

@loicdescotte
Copy link
Contributor

Recurring demand from a few number of users

@dgouyette dgouyette assigned dgouyette and unassigned dgouyette Apr 28, 2018
@loicdescotte loicdescotte added this to the 3.0 milestone May 9, 2018
@loicdescotte loicdescotte modified the milestones: 3.0, 3.1 Jul 29, 2018
@loicdescotte
Copy link
Contributor Author

With Scala 2.13 it will be possible to do it without macro with something like :

  def show(p: Product): String =
    p.productElementNames.zip(p.productIterator)
     .map { case (name, value) => s"$name=$value" }
     .mkString(p.productPrefix + "(", ", ", ")")

@loicdescotte
Copy link
Contributor Author

pushed #117 PR with macro-free show method on case classes

@loicdescotte loicdescotte changed the title Write def macro for Show Write def (macro?) for Show Sep 20, 2018
@loicdescotte loicdescotte modified the milestones: 3.1, 4.0 May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants