let's say i have these two macros which are identical except for the macro name:
macro h1 {
case {$name ($x (,) ...)} => {
letstx $nameVal = [makeValue(unwrapSyntax(#{$name}), null)]
return #{React.createElement($nameVal, $x (,) ...)}
}
}
macro h2 {
case {$name ($x (,) ...)} => {
letstx $nameVal = [makeValue(unwrapSyntax(#{$name}), null)]
return #{React.createElement($nameVal, $x (,) ...)}
}
}
what are my options for code reuse here? can i have a macro generate a macro?
or could i minimally place the body portion (beginning with letstx...
) in it's own 'internal' macro?: