-
Notifications
You must be signed in to change notification settings - Fork 21
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
feature: multiple-values and separator
#75
Conversation
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
==========================================
+ Coverage 74.84% 75.46% +0.61%
==========================================
Files 8 8
Lines 318 326 +8
==========================================
+ Hits 238 246 +8
Misses 80 80
Continue to review full report at Codecov.
|
3bd821a
to
e023ba1
Compare
@@ -19,119 +19,147 @@ public class Debug { | |||
// MARK: Standard API | |||
|
|||
extension Debug { | |||
/// Output `target` to console. | |||
/// Output `targets` to console. |
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.
s/target/targets/g
public static func print( | ||
_ target: Any | ||
_ targets: Any..., | ||
separator: String = " " |
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.
This default value " "
is similar to standard library.
https://developer.apple.com/documentation/swift/1541053-print
} | ||
|
||
// MARK: - private | ||
|
||
private static func _print( | ||
_ target: Any | ||
_ targets: [Any], |
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.
Can't use targets: Any...
because targets
are passed to one array of argument instead of multiple values called from print() in this source.
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.
That is due to Swift language design😎
separator
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.
OK!
Support multiple-values to output like print of standard library.
Example
Limitation
Operator based API such as
Debug.p >>>
is not supported multiple values. Because operator must have one or two arguments, this is limitation of Swift.Related
#76