Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp authored May 7, 2024
1 parent ba66287 commit 057c110
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,16 @@ You can use the function `compute_reactive_node(expression)` to explore an expre

### Example for `compute_reactive_node`

Let's compute the `ReactiveNode` for these two expressions:

```julia
julia> # the two expressions that we will use in this example:

julia> e1 = :(weather = magic() + science);

julia> e2 = :(weather() = magic() + science);
```

First one:

```julia
julia> r1 = ExpressionExplorer.compute_reactive_node(e1)
ExpressionExplorer.ReactiveNode(Set([:+, :magic, :science]), Set([:weather]), Set{Symbol}(), Set{ExpressionExplorer.FunctionNameSignaturePair}(), Set{Symbol}(), Set{Symbol}())
Expand All @@ -74,6 +75,8 @@ julia> r1.funcdefs_without_signatures
Set{Symbol}()
```

Second one, note that `weather` is a function definition, so it does not show up in `r2.definitions`. If you want everything that is defined, you can use `r2.definitions ∪ r2.funcdefs_without_signatures`.

```julia
julia> r2 = ExpressionExplorer.compute_reactive_node(e2)
ExpressionExplorer.ReactiveNode(Set([:+, :magic, :science]), Set{Symbol}(), Set{Symbol}(), Set(ExpressionExplorer.FunctionNameSignaturePair[ExpressionExplorer.FunctionNameSignaturePair([:weather], 0xa2e6e5b3d2eee6b5)]), Set([:weather]), Set{Symbol}())
Expand Down

0 comments on commit 057c110

Please sign in to comment.