Skip to content

Commit 17eeb7f

Browse files
exports
1 parent 3d0a2de commit 17eeb7f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/TermInterface.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ must also be defined for `x` appropriately.
88
"""
99
isterm(x) = false
1010
isterm(x::Type{Expr}) = true
11+
export isterm
1112

1213
"""
1314
symtype(x)
@@ -17,6 +18,7 @@ Returns the symbolic type of `x`. By default this is just `typeof(x)`.
1718
function symtype(x)
1819
typeof(x)
1920
end
21+
export symtype
2022

2123
"""
2224
issym(x)
@@ -25,6 +27,7 @@ Returns `true` if `x` is a symbol. If true, `nameof` must be defined
2527
on `x` and must return a Symbol.
2628
"""
2729
function issym end
30+
export issym
2831

2932
"""
3033
gethead(x)
@@ -35,13 +38,15 @@ is the function being called.
3538
"""
3639
function gethead end
3740
gethead(e::Expr) = e.head
41+
export gethead
3842

3943
"""
4044
getargs(x)
4145
4246
Get the arguments of `x`, must be defined if `isterm(x)` is `true`.
4347
"""
4448
getargs(e::Expr) = e.args
49+
export getargs
4550

4651
"""
4752
arity(x)
@@ -50,13 +55,17 @@ Returns the number of arguments of `x`. Implicitly defined
5055
if `getargs(x)` is defined.
5156
"""
5257
arity(x) = length(getargs(x))
58+
export arity
59+
5360

5461
"""
5562
metadata(x)
5663
5764
Return the metadata attached to `x`.
5865
"""
5966
metadata(x) = nothing
67+
export metadata
68+
6069

6170
"""
6271
metadata(x, md)
@@ -82,6 +91,7 @@ similarterm(x::Type{Expr}, head, args; type=nothing, metadata=nothing) = Expr(he
8291
function similarterm(x::Type{T}, head::T, args; type=nothing, metadata=nothing) where T
8392
if !isterm(T) head else head(args...) end
8493
end
94+
export similarterm
8595

8696
end # module
8797

0 commit comments

Comments
 (0)