It seems that \setbox0=\vbox{\hbox{abc}}\unvbox0 is not equivalent to \hbox{abc}: the former does not insert a \baselineskip in the following situation.
\vbox{%
\hbox{XY}%
\hbox{abc}%
\hbox{def}
}
\vbox{% missing baselineskip before \unvbox0
\hbox{XY}%
\setbox0=\vbox{\hbox{abc}}%
\unvbox0
\hbox{def}
}
A solution might be
\vbox{% the baselineskip is inserted when we write \box0, then remove it.
\hbox{XY}%
\setbox0=\vbox{\hbox{abc}}%
\box0
\setbox2=\lastbox
\unvbox2
\hbox{def}
}
but is it really the right way to do it?
For information, I am trying to emulate the behaviour of \halign with hand-made boxes, and I don't think that I will be able to put the \hbox{abc} (corresponding to rows) directly on the current vertical list since the rows need to all be read and the glue left unset, until the end of the tabular is reached and we can know the width of each column. Resetting the glue requires me to go through the list of row boxes, \unhbox them, \unhbox and re-\hbox each cell, etc.
\bye
\byethere. =) egreg answered your question, but one possibility might be setting\baselineskip=0pt \lineskip=0ptand the inserting a\strutsimilar to whatarraydoes. – TH. Apr 14 '11 at 22:07\prevdepthis probably the way to go. – Bruno Le Floch Apr 15 '11 at 01:50