Skip to content

Commit 8118888

Browse files
committed
Change tag kwarg to accept :default, :type, or :hash
1 parent 50b2f06 commit 8118888

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/config.jl

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@ Base.eltype(cfg::AbstractConfig) = eltype(typeof(cfg))
106106
function maketag(kind::Union{Symbol,Nothing}, f, X)
107107
if kind === :default
108108
return Tag(f, X)
109-
elseif kind === :small
109+
elseif kind === :type
110+
return Tag(f, X)
111+
elseif kind === :hash
110112
return SmallTag(f, X)
111113
elseif kind === nothing
112114
return nothing
113115
else
114-
throw(ArgumentError("tag may be :default, :small, or nothing"))
116+
throw(ArgumentError("tag may be :default, :type, :hash, or nothing"))
115117
end
116118
end
117119

@@ -137,8 +139,8 @@ If `f!` is `nothing` instead of the actual target function, then the returned in
137139
be used with any target function. However, this will reduce ForwardDiff's ability to catch
138140
and prevent perturbation confusion (see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).
139141
140-
If `tag` is `:small`, a small hash-based tag is provided. This tracks perturbation confusion
141-
with similar accuracy, but is much smaller when printing types.
142+
If `tag` is `:hash`, a small hash-based tag is provided. This tracks perturbation confusion
143+
with similar accuracy, but is much smaller than `tag = :type`, which stores the full type.
142144
143145
This constructor does not store/modify `y` or `x`.
144146
"""
@@ -189,8 +191,8 @@ If `f` or `tag` is `nothing`, then the returned instance can be used with any ta
189191
However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion
190192
(see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).
191193
192-
If `tag` is `:small`, a small hash-based tag is provided. This tracks perturbation confusion
193-
with similar accuracy, but is much smaller when printing types.
194+
If `tag` is `:hash`, a small hash-based tag is provided. This tracks perturbation confusion
195+
with similar accuracy, but is much smaller than `tag = :type`, which stores the full type.
194196
195197
This constructor does not store/modify `x`.
196198
"""
@@ -243,8 +245,8 @@ If `f` or `tag` is `nothing`, then the returned instance can be used with any ta
243245
However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion
244246
(see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).
245247
246-
If `tag` is `:small`, a small hash-based tag is provided. This tracks perturbation confusion
247-
with similar accuracy, but is much smaller when printing types.
248+
If `tag` is `:hash`, a small hash-based tag is provided. This tracks perturbation confusion
249+
with similar accuracy, but is much smaller than `tag = :type`, which stores the full type.
248250
249251
This constructor does not store/modify `x`.
250252
"""
@@ -285,8 +287,8 @@ If `f!` or `tag` is `nothing`, then the returned instance can be used with any t
285287
However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion
286288
(see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).
287289
288-
If `tag` is `:small`, a small hash-based tag is provided. This tracks perturbation confusion
289-
with similar accuracy, but is much smaller when printing types.
290+
If `tag` is `:hash`, a small hash-based tag is provided. This tracks perturbation confusion
291+
with similar accuracy, but is much smaller than `tag = :type`, which stores the full type.
290292
291293
This constructor does not store/modify `y` or `x`.
292294
"""
@@ -345,8 +347,8 @@ If `f` or `tag` is `nothing`, then the returned instance can be used with any ta
345347
However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion
346348
(see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).
347349
348-
If `tag` is `:small`, a small hash-based tag is provided. This tracks perturbation confusion
349-
with similar accuracy, but is much smaller when printing types.
350+
If `tag` is `:hash`, a small hash-based tag is provided. This tracks perturbation confusion
351+
with similar accuracy, but is much smaller than `tag = :type`, which stores the full type.
350352
351353
This constructor does not store/modify `x`.
352354
"""
@@ -386,8 +388,8 @@ If `f` or `tag` is `nothing`, then the returned instance can be used with any ta
386388
However, this will reduce ForwardDiff's ability to catch and prevent perturbation confusion
387389
(see https://github.com/JuliaDiff/ForwardDiff.jl/issues/83).
388390
389-
If `tag` is `:small`, a small hash-based tag is provided. This tracks perturbation confusion
390-
with similar accuracy, but is much smaller when printing types.
391+
If `tag` is `:hash`, a small hash-based tag is provided. This tracks perturbation confusion
392+
with similar accuracy, but is much smaller than `tag = :type`, which stores the full type.
391393
392394
This constructor does not store/modify `x`.
393395
"""

0 commit comments

Comments
 (0)