Skip to content

Commit 3f287f5

Browse files
committed
fixed doctests
1 parent 5905206 commit 3f287f5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/varname.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ julia> vn = VarName{:x}(Setfield.IndexLens((Colon(), 1)) ∘ Setfield.IndexLens(
2323
x[:,1][2]
2424
2525
julia> vn.indexing
26-
((Colon(), 1), (2,))
26+
(@lens _[Colon(), 1][2])
2727
2828
julia> @varname x[:, 1][1+1]
2929
x[:,1][2]
@@ -118,7 +118,7 @@ julia> getindexing(@varname(x[1][2:3]))
118118
(@lens _[1][2:3])
119119
120120
julia> getindexing(@varname(y))
121-
()
121+
(@lens _)
122122
```
123123
"""
124124
getindexing(vn::VarName) = vn.indexing
@@ -322,7 +322,7 @@ e.g. `_[1][2].a[2]` and `_[1][2].a`. In such a scenario we do the following:
322322
which then returns `false`.
323323
324324
# Example
325-
```jldoctest; setup=:(using Setfield)
325+
```jldoctest; setup=:(using Setfield; using AbstractPPL: subsumes_index)
326326
julia> t = @lens(_[1].a); u = @lens(_[1]);
327327
328328
julia> subsumes_index(t, u)
@@ -438,10 +438,9 @@ Return `vn` instantiated on `x`, i.e. any runtime information evaluated using `x
438438
439439
# Examples
440440
```jldoctest; setup=:(using Setfield)
441-
442441
julia> x = (a = [1.0 2.0;], );
443442
444-
julia> AbstractPPL.concretize(@lens(_.a[1, end][:]), x)
443+
julia> AbstractPPL.concretize(@varname(x.a[1, end][:]), x)
445444
x.a[1,2][:]
446445
```
447446
"""

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
34
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
45

56
[compat]
67
Documenter = "0.26.3, 0.27"
8+
Setfield = "0.7.1"
79
julia = "1"

0 commit comments

Comments
 (0)