All local variables (aka shorthands) in a calculation need to be declared ahead of time. It is not possible to have a RHS of an equation in a calculation that defines a temporary variable. Allowing this would turn the equations in a calculation from a list into a tree structure, which would simplify certain cases.
where the Block[] expression could easily introduce the temporary variable to simplify calculating the inverse. Of course, other applications exist as well; for example, temporaries that are only needed for parts of the BSSN equations would not be visible to the whole BSSN calculation.
All local variables (aka shorthands) in a calculation need to be declared ahead of time. It is not possible to have a RHS of an equation in a calculation that defines a temporary variable. Allowing this would turn the equations in a calculation from a list into a tree structure, which would simplify certain cases.
For example, one could then write
gu[ua,ub] -> MatrixInverse[g[la,lb]
where MatrixInverse is defined as
Block[{detg}, { detg -> MatrixDeterminant[g[la,lb]] }, 1/detg MatrixDeterminant[g[la,lb]] MatrixInverse[g[la,lb]]]
where the Block[] expression could easily introduce the temporary variable to simplify calculating the inverse. Of course, other applications exist as well; for example, temporaries that are only needed for parts of the BSSN equations would not be visible to the whole BSSN calculation.