Description
Index
Documentation
CTBase.Description
— TypeA description is a tuple of symbols. Description
is a type alias for a tuple of symbols.
julia> const Description = Tuple{DescVarArg}
See also: DescVarArg
.
Example
Base.show
is overloaded for descriptions, that is tuple of descriptions are printed as follows:
julia> display( ( (:a, :b), (:b, :c) ) )
(:a, :b)
(:b, :c)
CTBase.add
— Methodadd(
x::Tuple{Vararg{Tuple{Vararg{Symbol}}}},
y::Tuple{Vararg{Symbol}}
) -> Tuple{Tuple{Vararg{Symbol}}}
Concatenate the description y
to the tuple of descriptions x
if x
does not contain y
and return the new tuple of descriptions. Throw an error if the description y
is already contained in x
.
Example
julia> descriptions = ()
julia> descriptions = add(descriptions, (:a,))
(:a,)
julia> descriptions = add(descriptions, (:b,))
(:a,)
(:b,)
julia> descriptions = add(descriptions, (:b,))
ERROR: IncorrectArgument: the description (:b,) is already in ((:a,), (:b,))
CTBase.add
— Methodadd(
x::Tuple{},
y::Tuple{Vararg{Symbol}}
) -> Tuple{Tuple{Vararg{Symbol}}}
Return a tuple containing only the description y
.
Example
julia> descriptions = ()
julia> descriptions = add(descriptions, (:a,))
(:a,)
julia> print(descriptions)
((:a,),)
julia> descriptions[1]
(:a,)
CTBase.getFullDescription
— MethodgetFullDescription(
desc::Tuple{Vararg{Symbol}},
desc_list::Tuple{Vararg{Tuple{Vararg{Symbol}}}}
) -> Tuple{Vararg{Symbol}}
Return a complete description from an incomplete description desc
and a list of complete descriptions desc_list
. If several complete descriptions are possible, then the first one is returned.
Example
julia> desc_list = ((:a, :b), (:b, :c), (:a, :c))
(:a, :b)
(:b, :c)
(:a, :c)
julia> getFullDescription((:a,), desc_list)
(:a, :b)
CTBase.remove
— Methodremove(
x::Tuple{Vararg{Symbol}},
y::Tuple{Vararg{Symbol}}
) -> Tuple{Vararg{Symbol}}
Return the difference between the description x
and the description y
.
Example
julia> remove((:a, :b), (:a,))
(:b,)