Open mimoo opened 1 month ago
this is something we are missing currently, and I think we should aim to support this at some point. It'd be good to see a proposal on that. For example with sum types we could have something like this:
use std::bits; struct MaybeBinary { val: Field, bin: Option<[Boolean; 32]> } fn MaybeBinary.xor(a: &mut Self, b: &mut Self) -> Self { if a.bin.is_none() { a.bin = Some(bits::decompose(a, 32)); } if b.bin.is_none() { b.bin = Some(bits::decompose(b, 32)); } // ... }
this is something we are missing currently, and I think we should aim to support this at some point. It'd be good to see a proposal on that. For example with sum types we could have something like this: