I prefer test first programming. Therefore we need some syntax to get multi subs into the assembler. Albeit we even have two sets of MMD function registering opcodes (object.ops:mmd* , pmc.ops:mmdvt*) these are not adequate to implement a general MMD scheme. The opcodes allow just 2-dimensional MMD and second, the opcodes don't really help to define multi subs, as the MMD information should be attached to the Sub object itself and not be created from distance by some opcode, IMHO.

Syntax proposal:

  .sub foo @MULTI
    .invocant Integer a
    .invocant Float b
    .param pmc c
    ...

The @MULTI pragma goes along with the C<pcc_sub_proto>, it just adds another flag bit.
The C<.invocant> can easily be parsed in the C<sub_params> rule, the terminal C<.invocant> is already defined. The C<type> rule allows currently to specify only known types, this check can be skipped so that arbitrary class names can be specified.


Comments welcome,
leo



Reply via email to