From r-devel at akersting.de  Tue Jun 13 12:57:39 2017
From: r-devel at akersting.de (Andreas Kersting)
Date: Tue, 13 Jun 2017 12:57:39 +0200
Subject: [Rd] print for lists evaluates "AsIs"-elements of type "language"
Message-ID: <99eb6384-8dab-745b-2565-8c216e84f995@akersting.de>

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.



[Rd] print for lists evaluates "AsIs"-elements of type "language"
Andreas Kersting