Some parrot opcodes like interpinfo, stringinfo, warnings{on,off} have constant items as an argument selecting some action. These are well documented and working fine, but rather unreadable in PASM/PIR source code and are suboptimal if some item ever needs a different value.

So I'd like to generate a new directory hierarchy e.g.

  runtime/parrot/include
         /parrot/libs  # N/Y

and place files, containing such constant definitions in F<runtime/parrot/include>.

  e.g.
  # warnings.pasm               # or .pinc (?)
  .constant WARNINGS_UNDEF 1
  .constant WARNINGS_IO    2
  ...
  # interpinfo.pasm
  .constant GC_ALLOCATED_MEMORY 1
  .constant GC_DOD_RUNS         2
  ...
  # io.pasm
  .constant IO_FD_STDIN  0
  ...

This would need finally some include search path (for an installed parrot). Also the C<.constant> directive in imcc would be enabled - or we use the typed C<.const <type> ID = val> directive of imcc.

I can imagine that the latter might be better for creating typed and PMC constants:

  .const float ONE = 1  # (NUMVAL)1.0
  .const Exception FooBar_Exception = "Fubared"

Comments welcome.
leo




Reply via email to