File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,24 @@ julia> getindexing(@varname(y))
88
88
"""
89
89
getindexing (vn:: VarName ) = vn. indexing
90
90
91
+ """
92
+ get(obj, vn::VarName{sym})
93
+
94
+ Alias for `get(obj, PropertyLens{sym}() ∘ vn.indexing)`.
95
+ """
96
+ function Setfield. get (obj, vn:: VarName{sym} ) where {sym}
97
+ return Setfield. get (obj, PropertyLens {sym} () ∘ vn. indexing)
98
+ end
99
+
100
+ """
101
+ set(obj, vn::VarName{sym}, value)
102
+
103
+ Alias for `set(obj, PropertyLens{sym}() ∘ vn.indexing, value)`.
104
+ """
105
+ function Setfield. set (obj, vn:: VarName{sym} , value) where {sym}
106
+ return Setfield. set (obj, PropertyLens {sym} () ∘ vn. indexing, value)
107
+ end
108
+
91
109
92
110
Base. hash (vn:: VarName , h:: UInt ) = hash ((getsym (vn), getindexing (vn)), h)
93
111
Base.:(== )(x:: VarName , y:: VarName ) = getsym (x) == getsym (y) && getindexing (x) == getindexing (y)
You can’t perform that action at this time.
0 commit comments