default_kw and force_kw macros for recipes

This commit is contained in:
Thomas Breloff 2016-05-04 13:24:44 -04:00
parent 3c09921cbd
commit 59c1e24371
2 changed files with 10 additions and 0 deletions

View File

@ -144,6 +144,9 @@ export
arcdiagram,
chorddiagram,
@default_kw,
@force_kw,
translate,
translate!,
rotate,

View File

@ -28,6 +28,13 @@ function _apply_recipe(d::KW, args...; issubplot=false, kw...)
args
end
macro default_kw(k, v)
esc(:(get!(d, $k, $v)))
end
macro force_kw(k, v)
esc(:(d[$k] = $v))
end
# ---------------------------------------------------------------------------