The problem is the Attributes
alloted to Downvalues
are HoldAll
and Protected
. This is in addition to the HoldAll
attribute of Table
.
Hence, in the first case, first, Downvalues
returns an empty list, which Table takes in to create its own list. So, you get a list of two empty lists.
In the second case, you don't have such an intermediary function which has a HoldAll
attribute to begin with.
Edit 1:
Table[DownValues[i], {i, {test1, test2}}] // Trace
This clearly shows, that Downlnvalues[i]
never gets substituted by Downvalues[test1]
or Downvalues[test2]
.
Hope this clears things out