function mainfcn ()
  persistent recurse_count = 0;

  [s1, c1] = __current_scope__ ();
  printf ("Scope, Context in main function: %d, %d\n", s1, c1);
  subfcn ();
  function nestfcn ()
    [s3, c3] = __current_scope__ ();
    printf ("Scope, Context in nested function: %d, %d\n", s3, c3);
  endfunction  
  nestfcn ();

  printf ("------------------------------------------------------------\n");

  if (recurse_count++ < 5)
    mainfcn ();
  else
    return;
  endif

endfunction

function subfcn ()
  [s1, c1] = __current_scope__ ();
  printf ("Scope, Context in subfunction: %d, %d\n", s1, c1);
endfunction
