-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glossary returning unanticipated definitions, if leading characters match #338
Comments
Thanks for the report, @michaelmcd18. Lists do partial matching by default. I can turn this off for glossary objects. x <- list(michael = "scientist")
x$mi
#> [1] "scientist" Created on 2024-06-12 with reprex v2.0.2 |
[ I see @kylebaron just posted, but I'll post this reply just for additional info. I'm not against turning it off. ] Related to discussion at #326 (comment)
Hmm, I'm not a fan of the partial match with x <- list(foo = "foo", bar = "bar")
x$fo
#> [1] "foo"
options(warnPartialMatchDollar = TRUE)
x$fo
#> Warning in x$fo: partial match of 'fo' to 'foo'
#> [1] "foo" One way to avoid it is with x[["fo"]]
#> NULL |
I took care of this in https://github.com/metrumresearchgroup/yspec/blob/main/R/class-yspec.R#L78-L84 |
Thanks for the explanations @kylebaron @kyleam! I certainly don't want to add extra work, it seems like if I was using |
Found this case while using the new
read_glossary()
function. Here's the example case:The glossary.tex file contains definitions for
ng
andMCMC
. It does NOT have definitions forn
orMC
. However, I get the following:It seems if the leading characters match an existing definition it returns that definition. I'd expect an error if there wasn't an exact match.
The text was updated successfully, but these errors were encountered: