On Jul 7, 2005, at 18:02, Chip Salzenberg wrote:
 Say a new bit
":opt_count", which means that the given register should be assigned
the count?

     .sub "foo"
         .param int beta
         .param string gamma :optional
         .param string delta :optional
         .param int optc :opt_count
         .param pmc epsilon :slurpy

In this example, the range of values for optc would be 0..2.  That's
because epsilon is not optional, and will thus always be set to an
aggregate PMC, just maybe an empty one.

It could likely be illegal for :optional to appear after the
:opt_count, not that there's any need for such a thing anyway.

My gut feeling is that it isn't a problem, when an :optional appers after :opt_count. I think, I just remember the arg number/type of :opt_count and fill it at the end of the argument passing.


Would that work for everyone?


Works fine for me and sounds very reasonable. It also just saves executing the get_argc opcode, the result is already there.

If no one beats me (and if there are no major objections) I'll just implement it tomorrow.

leo

Reply via email to