Loading ...
Sorry, an error occurred while loading the content.

69Document variables in lib/ExtUtils/ParseXS.pm

Expand Messages
  • James E Keenan
    Mar 15, 2010
    • 0 Attachment

      The madness of ParseXS is perhaps best displayed by the following two

      our (
      $ProtoUsed, @InitFileCode, $FH, $proto_re, $Overload, $errors,
      $hiertype, $WantPrototypes, $WantVersionChk, $WantLineNumbers,
      $dir, $filename, %IncludedFiles, %input_expr, %output_expr,
      %type_kind, %proto_letter, $BLOCK_re, $lastline, $lastline_no,
      $Prefix, @line, %args_match, %defaults, %var_types, %arg_list,
      $processing_arg_with_types, %argtype_seen, %in_out, %lengthof,
      $proto_in_this_xsub, $scope_in_this_xsub, $interface,
      $interface_macro, $interface_macro_set, $ProtoThisXSUB,
      @line_no, $ret_type, $func_name, $Full_func_name, $Packprefix,
      %XsubAliases, %XsubAliasValues, %Interfaces, @Attributes, %
      outargs, $pname,
      $thisdone, $retvaldone, $deferred, $gotRETVAL, $condnum, $cond,
      $RETVAL_code, $name_printed, $func_args, @XSStack, $ALIAS,
      our ($DoSetMagic, $newXS, $proto, $Module_cname, $XsubAliases,
      $Interfaces, );

      ... and this is better than it was! Most of those 'our' variables
      were until recently pure global variables! Oy, vey! Talk about
      coping with scoping!

      Ultimately, these will not be separate variables: global, our, my,
      local or chopped liver. They will be elements in an EU::PXS object.

      But before we get there, we need to be able to define -- in human
      language -- what each of these variables stores.

      So here's yet another task which can be taken up by anyone associated
      with the project: Document these variables. For extra credit,
      identify which subroutines these 'our' variables are currently used in.

      And if you don't like dealing with 'our' variables, you could do the
      same thing for 'my' variables inside sub process_files().


      Thank you very much.
      Jim Keenan