I'm currently working on (implicitly) maintaining the nesting structure of a Thorin program. One major headache is that right now, you can arbitrarily change the ops of a mutable. With this patch you can still change the ops of a mutable, but you have to obey certain rules:
If Def::is_set() is ...
... false, Def::set the operands from left (i == 0) to right (i == num_ops() - 1).
... true, Def::reset the operands from left to right as in 1i.
In addition, you can invoke Def::unset() at any time to start over with 1i:
mut->unset()->set({a, b, c}); // This will always work, but should be your last resort.
Violating these rule will raise an assertion.
Putting aside that these rules will help me to keep track of some infos in a much more efficient way, having these rules in place will also help to prevent you from doing really questionable things - to say at least.
Other Changes
This PR already includes #205
Made some members private instead of protected in Def
You can now specify a curry/trip count for axioms even if you have not specified a normalizer.
Using this feature for %direct.cps2ds_dep.
Using match<direct::cps2ds_dep> instead of nested ifs in cps2ds.cpp.
Changes
Restricting Write Access for Mutables
I'm currently working on (implicitly) maintaining the nesting structure of a Thorin program. One major headache is that right now, you can arbitrarily change the ops of a mutable. With this patch you can still change the ops of a mutable, but you have to obey certain rules:
false
, Def::set the operands from left (i == 0
) to right (i == num_ops() - 1
).true
, Def::reset the operands from left to right as in 1i.Violating these rule will raise an assertion.
Putting aside that these rules will help me to keep track of some infos in a much more efficient way, having these rules in place will also help to prevent you from doing really questionable things - to say at least.
Other Changes
private
instead ofprotected
inDef
%direct.cps2ds_dep
.match<direct::cps2ds_dep>
instead of nestedif
s incps2ds.cpp
.cps2ds.cpp