  We introduce a 'grading switching' for arbitrary nonassociative algebras of
prime characteristic p, aimed at producing a new grading of an algebra from a
given one. We take inspiration from a fundamental tool in the classification
theory of modular Lie algebras known as 'toral switching', which relies on a
delicate adaptation of the exponential of a derivation. Our grading switching
is achieved by evaluating certain generalized Laguerre polynomials of degree
p-1, which play the role of generalized exponentials, on a derivation of the
algebra. A crucial part of our argument is establishing a congruence for them
which is an appropriate analogue of the functional equation
exp(x)*exp(y)=exp(x+y) for the classical exponential. Besides having a wider
scope, our treatment provides a more transparent explanation of some aspects of
the original toral switching, which can be recovered as a special case.
