TritonVM / tasm-lang

Writing tasm with Rust syntax
15 stars 2 forks source link

add `Result` type #50

Closed jan-ferdinand closed 10 months ago

jan-ferdinand commented 10 months ago

fix #49

Sword-Smith commented 10 months ago

I realized that if we represent a Result as a DataType::Enum internally, then get match support and correct stack-management for free. We even get the constructor logic Result::Ok(a) and Result::Error(b) for free as well!

This can be handled already in the grafter, resolving Result to the correct DataType::Enum instance.