Andreas Kersting
2017-Jun-13 10:57 UTC
[Rd] print for lists evaluates "AsIs"-elements of type "language"
Consider the following code snippets: > list(quote(1 + 1), I(quote(1 + 1))) [[1]] 1 + 1 [[2]] [1] 2 # should also be 1 + 1!? > str(list(quote(1 + 1), I(quote(1 + 1)))) List of 2 $ : language 1 + 1 $ : language + 1 1 # why is this line different from the one above? ..- attr(*, "class")= chr "AsIs" > quote(1 + 1) 1 + 1 > I(quote(1 + 1)) 1 + 1 # OK > str(quote(1 + 1)) language 1 + 1 > str(I(quote(1 + 1))) language + 1 1 # again different - attr(*, "class")= chr "AsIs" This inconsistency is particularly striking when printing the individual elements of a list works but printing the whole list does not: > l <- list(quote(length(a)), I(quote(length(a)))) > l[[1]] length(a) > l[[2]] length(a) > l [[1]] length(a) [[2]] Error in print(length(a)) : object 'a' not found Should we consider this a bug? If so, I can add it to Bugzilla.