Skip to content

Commit

Permalink
unsorted_arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alessandro committed Sep 10, 2021
1 parent 018fba6 commit 7a30e26
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ Construct a new term with the operation `f` and arguments `args`, the term shoul

### Optional

#### `unsorted_arguments(x)`

If x is a term satisfying `istree(x)` and your term type `T` orovides
and optimized implementation for storing the arguments, this function can
be used to retrieve the arguments when the order of arguments does not matter
but the speed of the operation does. Defaults to `arguments(x)`.

#### `symtype(x)`

The supposed type of values in the domain of x. Tracing tools can use this type to
Expand Down
13 changes: 13 additions & 0 deletions src/TermInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@ Get the arguments of `x`, must be defined if `istree(x)` is `true`.
function arguments end
export arguments


"""
unsorted_arguments(x::T)
If x is a term satisfying `istree(x)` and your term type `T` orovides
and optimized implementation for storing the arguments, this function can
be used to retrieve the arguments when the order of arguments does not matter
but the speed of the operation does.
"""
unsorted_arguments(x) = arguments(x)
export unsorted_arguments


"""
arity(x)
Expand Down

0 comments on commit 7a30e26

Please sign in to comment.