flet macro was deprecated in Emacs 24.3 and replaced
with two similar macros -
flet was used to temporarily override function definitions.
This was an analogue of a dynamically scoped
let that operates on the function
cell of symbols rather than their value cell.
The ability to dynamically rebind a functions was very useful for stubbing purposes in unit tests (you do write unit tests, don’t you?).
(flet ((projectile-project-root () "/path/to/project") (projectile-project-name () "project")) ...)
projectile-project-name are impure
functions (they depend on the current directory) and testing functions
that use them internally would normally be problematic. However,
flet gives us the ability to override their actual definitions in
flet’s official replacement
cl-flet is lexically bound
and this is no longer possible with it.