I\'m now studying Emacs Lisp from the reference manual and Common Lisp from a LISP Book.
from the Common Lisp book
>> (setf power-of-two
(let
Emacs24 from bzr now supports lexical binding out of the box; it just isn't activated by default since there are many packages which still deliberately or inadvertently depend on dynamical scoping. Your above code should work just fine in Emacs24 in a buffer where the variable 'lexical-binding' is set to 't'.