Closed nsensfel closed 3 years ago
Small hurdle: (sequence my_sequence)
returns a computation that corresponds to the sequence my_sequence
, but since my_sequence
might not have been defined yet, its full type (which should include the sequence's signature) isn't available.
This isn't an issue with the call
or jump
instructions, since those instructions have parameters which indicate the expected signature. The (sequence my_sequence)
computation does not.
Added in https://github.com/nsensfel/tonkadur/commit/22ec7b935d4fbac94ddff580b9649f6748d7444d.
Aforementioned issue resolved by having the sequence type accept "proposed signatures". Basically, whenever the sequence type needs to fit a signature, that targeted signature is first proposed to the sequence type. If that sequence type already has a signature, nothing happens. Otherwise, it becomes the sequence type's signature.
There's also a check at the end of the compilation to make sure all uses of a procedure accept the signature that the procedure in question is defined with (same system as with the call
and jump
instructions).
Procedures/Sequences should be able to be stored in variables or passed as parameter just like lambda functions are.