Skip to content

Commit

Permalink
reorder items in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shashi authored Mar 27, 2024
1 parent 4459f42 commit eea4436
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ and [Metatheory.jl](https://github.com/0x0f0f0f/Metatheory.jl).
Returns `true` if `x` is an expression tree (an S-expression). If true, `head`
and `children` methods must be defined for `x`.

#### `iscall(x::T)`

Returns `true` if `x` is a function call expression. If true, `operation`, `arguments` must also be defined for `x::T`.


#### `head(x)`

Returns the head of the S-expression.
Expand All @@ -27,17 +22,6 @@ Returns the head of the S-expression.

Returns the children (aka tail) of the S-expression.


#### `operation(x)`

Returns the function a function call expression is calling. `iscall(x)` must be
true as a precondition.

#### `arguments(x)`

Returns the arguments to the function call in a function call expression.
`iscall(x)` must be true as a precondition.

#### `maketerm(T, head, children, type=nothing, metadata=nothing)`

Constructs an expression. `T` is a constructor type, `head` and `children` are
Expand All @@ -57,6 +41,20 @@ Packages providing expression types _must_ implement this method for each expres
If your types do not support type information or metadata, you still need to accept
these arguments and may choose to not use them.

#### `iscall(x::T)`

Returns `true` if `x` is a function call expression. If true, `operation`, `arguments` must also be defined for `x::T`.

#### `operation(x)`

Returns the function a function call expression is calling. `iscall(x)` must be
true as a precondition.

#### `arguments(x)`

Returns the arguments to the function call in a function call expression.
`iscall(x)` must be true as a precondition.

### Optional

#### `arity(x)`
Expand Down

0 comments on commit eea4436

Please sign in to comment.