Skip to content

Commit

Permalink
Improve definition of @apply_regionally (#4178)
Browse files Browse the repository at this point in the history
By interpolating the function names we can call this macro also from other modules.
  • Loading branch information
giordano authored Mar 7, 2025
1 parent 795de5e commit c4185c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Utils/multi_region_transformation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ macro apply_regionally(expr)
func = expr.args[1]
args = expr.args[2:end]
multi_region = quote
apply_regionally!($func, $(args...))
$(apply_regionally!)($func, $(args...))
end
return quote
$(esc(multi_region))
Expand All @@ -218,7 +218,7 @@ macro apply_regionally(expr)
func = exp.args[1]
args = exp.args[2:end]
multi_region = quote
$ret = construct_regionally($Nret, $func, $(args...))
$ret = $(construct_regionally)($Nret, $func, $(args...))
end
return quote
$(esc(multi_region))
Expand All @@ -230,7 +230,7 @@ macro apply_regionally(expr)
func = arg.args[1]
args = arg.args[2:end]
new_expr.args[idx] = quote
apply_regionally!($func, $(args...))
$(apply_regionally!)($func, $(args...))
end
elseif arg isa Expr && arg.head == :(=)
ret = arg.args[1]
Expand All @@ -242,7 +242,7 @@ macro apply_regionally(expr)
func = exp.args[1]
args = exp.args[2:end]
new_expr.args[idx] = quote
$ret = construct_regionally($Nret, $func, $(args...))
$ret = $(construct_regionally)($Nret, $func, $(args...))
end
end
end
Expand Down

0 comments on commit c4185c6

Please sign in to comment.