Macro new_op1

Source
macro_rules! new_op1 {
    ($s:ident, $name:expr, $($t1:ident -> $rt:ident { $f:expr }),*) => { ... };
}
Expand description

Defines a macro to simplify the creation and implementation of unary operations in the synthesis framework.

This macro automates the process of setting up a new unary operation by invoking several components. It takes an identifier, a name, and a series of type transformation definitions, associating each with an expression used for transformation. It uses the impl_basic! macro to provide basic trait implementations for the operation, sets up the operation as an implementation of Enumerator1 from the forward::enumeration module, and then employs the impl_op1! macro to complete the detailed implementation needed for the operation including how it transforms various input types to the result type using the provided expression. This macro reduces repetitive code and ensures consistency when creating new operations.