Macro new_op2

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

Defines a macro for creating new binary operations within the expression framework.

This macro, new_op2, takes as input a series of tokens to set up a binary operation type, specifically an identifier $s, a name $name, and multiple tuples of input types ($t1 and $t2), return type $rt, and a functional expression $f.

The macro performs several tasks: it invokes an implementation macro, impl_basic!, for basic setup using the provided identifier and name. It implements the Enumerator2 trait for the operation using the impl syntax. Finally, it calls another implementation macro, impl_op2!, which probably performs the core operation setup, defining how each type of binary operation works using the provided type and functional expression pairs. This structure aids in generating consistent and concise definitions of new binary operations throughout the synthesis module.