zippy/ceptr

FILL_FROM_MATCH clashes with TEMPLATE_SIGNATURE

Opened this issue · 3 comments

zippy commented

currently FILL_FROM_MATCH expects a template as its second parameter. Unfortunately if you define a process with a FILL_FROM_MATCH instruction __d_tsig will see the slots in that code and auto-generate TEMPLATE_SIGNATURE for the process when its being defined by _d_define_process.

The creates a fundamental conflict. We might mean to be defining a process with slots, and how would we differentiate such a process from one using slots as data. This raises the general issue of quoting.

As a temporary fix, we could have something that overrides calling of __d_tsig in _d_define_process....

zippy commented

f514d8a adds a check into __d_tsig to ignore scanning FILL_FROM_MATCH

zippy commented

In the future when definitions aren't created through _d_define, but rather internally by a ceptr operation, this shouldn't be as much of an issue. __d_tsig is really only a convenience function so as not to have to manually specify the TEMPLATE_SIGNATURE. So in the end this would only be an issue if the SLOT in your FILL_FROM_MATCH template was exactly the same as some other slot to be filled at template resolution time. Then we would have the collision.
Perhaps the solution is to namespace slots in some way (and thus make them specific to a usage of the slot). This might be a solution to some of the possible slot collisions over in protocol resolution.

zippy commented

This same bug has bitten me again. Writing a function with LISTEN instruction in it has PARAMS to be passed into add_expectation some of which are the SLOT to refer to the pattern match.