-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
String interpolator for Show, without macros #1495
Conversation
Current coverage is 91.94% (diff: 100%)@@ master #1495 diff @@
==========================================
Files 244 245 +1
Lines 3621 3626 +5
Methods 3502 3503 +1
Messages 0 0
Branches 119 123 +4
==========================================
+ Hits 3329 3334 +5
Misses 292 292
Partials 0 0
|
} | ||
|
||
implicit class ShowInterpolator(val _sc: StringContext) extends AnyVal { | ||
def show(args: Shown*): String = StringContext(_sc.parts: _*) s (args: _*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StringContext(_sc.parts: _*)
can be replaced by _sc
, am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah... you're right, nice one.
I would exercise the principle of least power here and go with this solution over the macro one. It is much more transparent to the casual reader what is going on. |
This looks great 👍 That implicit conversion to Would |
Probably. Or its own syntax object. Happy to go either way. |
👍 to supporting both |
👍 |
|
Looking for another maintainer to 👍 this. |
👍 |
Non-macro alternative to #1489.
Happy to iterate - feedback welcome.