Closed omochi closed 7 years ago
this branch now includes #9 and #10
now working
I implemented followings.
func plot(_ x: [Double], _ y: [Double])
func scatter(_ x: [Double], _ y: [Double])
func hold(f: () throws -> Void) rethrows
and backward compatibility are presented with below.
public func addLine(
x: [Double], y: [Double])
{
hold {
plot(x, y)
}
}
public func addLine2(
x: [Double], y: [Double],
x2: [Double], y2: [Double])
{
hold {
plot(x, y)
scatter(x2, y2)
}
}
it tells API clearly for us.
After update Contents.swift(preinstalled presentation example code in book),
I remove addLine
and addLine2
.
Ofcourse, if you call plot
directly, it runs as hold { plot(x, y) }
.
it ready to merge
grouping api. its opened in #7.
I am now working.
This PR includes #10 for preparation.