When you declare a function within a function, the inner functions are only available in the scope in which they are declared, or in your case, the pad2
can only be called in the dmy
scope.
All the variables existing in dmy
are visible in pad2
, but it doesn't happen the other way around :D