Skip to main content
added 220 characters in body
Source Link
Subho
  • 1.5k
  • 1
  • 9
  • 18

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

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.

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

Source Link
Subho
  • 1.5k
  • 1
  • 9
  • 18

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.