Not only not allowed by the spec, but it doesn't necessarily even make any sense as stated. If a function has never been invoked, what do you want the values of its variables to be? Some languages have nested functions and i think usually nested functions a) can only be called from their outer function; and b) have access to the most recent invocation of the enclosing function. Something like this:

function a() {
  function b() {
    return c;
  }
  if(bar())
    a();
  int c = foo();
  int d = b();
}

a recurses, but you usually expect that b will access c in the most recent invocation.

I think it would be somewhat painful but definitely possible to implement nested functions using bcel to copy local variable values into global vars before invoking the nested function. or something like that. but that's certainly not the exact question asked.

Dick Eimers wrote:
Is there a way to access local variables declared in a function in
another function during run time.


No this is not allowed by spec.

-Dick


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to