Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Can anyone explain why in the following Grid expression the Row expressions are not evaluated ...

Grid[{{Row[1, " a"], Row[2, " b"]}, {Row[3, " c"], Row[4, " d"]}}, 
      Dividers -> All]  

enter image description here

... but when I do it this way they are?

row = (Row@{##}) &;
Grid[{{row[1, " a"], row[2, " b"]}, {row[3, " c"], row[4, " d"]}}, 
      Dividers -> All]  

enter image description here

share|improve this question

closed as too localized by Mr.Wizard Oct 22 '12 at 18:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

The answer is hidden in your question. The construction Row@{##}& works because Row takes a vector/list of expressions as input and with the {} you have defined such a vector! Try Row[{1,"a"}] will also work similar fashion. –  PlatoManiac Oct 22 '12 at 18:39

1 Answer 1

up vote 1 down vote accepted

Row[] takes a list as the argument.

In your first case, you failed to provide a list.

While in your second case:

row = (Row@{##}) &;
Grid[{{row[1, " a"], row[2, " b"]}, {row[3, " c"], row[4, " d"]}}] // FullForm

Grid[List[List[Row[List[1," a"]],Row[List[2," b"]]],
          List[Row[List[3," c"]],Row[List[4," d"]]]]]
share|improve this answer
Of course -- how stupid of me. –  m_goldberg Oct 22 '12 at 18:47
@m_goldberg I'll not throw the first stone :) –  belisarius Oct 22 '12 at 18:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.