Display List, If statement

I’ve got a simple question regarging display lists.
If my code would look like this:

// Some where global
bool expression;
GLuint dlUID = glGenlists(1);
expression = true;
glNewList(dlUID, GL_COMPILE);
glRotate(angle, 1.0, 0.0, 0.0);
glRotatef(angle, 0.0, 1.0, 0.0);
expression = false;

Would that always result in(like with compilers with #if statements they cut out the false statements):

glRotate(angle, 1.0, 0.0, 0.0);

regardles of what expression is after compilation of the list?
And what about modes, when some function needs something enabled(lets say lights), they are when the list is compiled, but would they still need to be enabled when the list is executed?
Thanx in advance,

The “if” is not compiled into the display list, so all that matters is the value of the expression at the time the list is compiled.

Display lists capture (most) OpenGL commands, not program logic. You can think of a display list as a record-and-playback mechanism, although in practice the implementation may be more elaborate (e.g. geometry in display lists may be optimized).

Ok thanx.
I have one last question.
If i’ve made a displaylist, and call that displaylist in a new displaylist(so the first one gets nested in the second one), then would the commands, from the first list, also be cached in the second list?Or is it just executing the other list?
And is there much difference between calling x lists with glCallList and having those x lists in one nested list?

When nesting display lists, the call to glCallList itself is saved.

Say you have a display list A which contains a call to display list B. If display list B is changed, then so is A, as A reference B.

Ok, thanx.