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
{{ message }}
Repository navigation
Write an XPath for extended known-literal expressions #963
I think c() and rep() are the most common ways to build constant expressions, so we can limit it to combinations of those. Note that I consider rep(1:3, n) as being "constant" here, as the variable part is "constant enough" for the places where we'd use this:
strings_as_factors_linter which looks for data.frames declared with known-character columns
expect_{type,length,named,s3_class}_linter which look for literal exprs in the 1st argument
I'm not sure whether it's good to call the rep(1:3, n) expression a constant (but willing to call it "almost constant").
Regarding functions used: 1:3 == seq_len(3) is what I default to due to 1:n being bad for n == 0.
This means we could whitelist seq, seq_len, seq_along and seq.int as well.
Activity
AshesITR commentedon Mar 21, 2022
I'm not sure whether it's good to call the
rep(1:3, n)expression a constant (but willing to call it "almost constant").Regarding functions used:
1:3 == seq_len(3)is what I default to due to1:nbeing bad forn == 0.This means we could whitelist
seq,seq_len,seq_alongandseq.intas well.