Open FL03 opened 4 months ago
It may be possible to generate a macro that represents the gradient;
extern crate acme;
use acme::operator;
fn main() {
let dx = mul_gradient!(x: 10f64);
let (x, y) = (3f64, 4f64);
let dx = mul_gradient!(x);
let dy = mul_gradient!(y);
assert_eq!(dx, y);
assert_eq!(dy, x);
}
#[operator]
pub fn mul<A, B, C>(x: A, y: B) -> C where A: core::ops::Mul<B, Output = C> {
x * y
}
Example
Try to integrate with the_lexical()
#[operator]
macro by collecting the String created by invoking