-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
These sorts of VarNames are non-sense, and I think the constructor should call them out and error:
julia> @varname(a.b[1:4].c)
a.b[1:4].cWhat would this mean? It could mean get the elements a.b[1:4] and get the field .c for each of them. However, that's not what this does in Julia. Rather, in Julia, indexing like that tries to get the field .c of the object a.b[1:4], which is probably an Array that only has fields ref and size. I don't think that's ever the thing we want to do in a probabilistic programming language context. Hence I think VarNames should allow an IndexLens with ranges or Colons only as the last lens.
Note that this should of course still be fine: @varname(a.b[2].c)
Metadata
Metadata
Assignees
Labels
No labels