You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the absence of any accessors for DCElement objects, I would expect the only available method of simply naming them to return the actual objects. This leads to the following unexpected behaviour:
library(atom4R)
packageVersion ("atom4R")
#> [1] '0.2.9999'a0<-DCAvailable$new (value=FALSE)
ls (a0) # okay#> ... expected outputd<-atom4R::DCEntry$new ()
d$addDCAvailable ("01-01-0001")
d$validate ()
#> [atom4R][INFO] Object 'DCEntry' is VALID according to Atom XML schemas!#> [1] TRUEa1<-d$available
ls (a1)
#> Error in list2env(list(<environment>), NULL, <environment>): names(x) must be a character vector of the same length as x
Everything is embedded within a list, and trying to access elements as $<element> does not behave as expected. It would arguably be safer to provide accessor methods to (1) enable easy and systematic access; and (2) avoid unexpected behaviour like this.
The text was updated successfully, but these errors were encountered:
There is no 'getter' accessor, if i understand well what you mean by accessor. We can add some basic getter method for DCElement if needed to facilitate getting some element based on field. Assuming value is what defines the unicity of the element, we might name the list, but it's not always the case, as we may have xml attributes. I will look into that and let you know
eblondel
changed the title
Accessors for DCElement objects
Accessors/getters for DCElement objects
May 18, 2022
In the absence of any accessors for DCElement objects, I would expect the only available method of simply naming them to return the actual objects. This leads to the following unexpected behaviour:
Created on 2022-05-18 by the reprex package (v2.0.1)
Happens because of this line:
atom4R/R/DCEntry.R
Line 85 in 31a0645
Everything is embedded within a list, and trying to access elements as
$<element>
does not behave as expected. It would arguably be safer to provide accessor methods to (1) enable easy and systematic access; and (2) avoid unexpected behaviour like this.The text was updated successfully, but these errors were encountered: