-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ACEsuit
committed
May 31, 2024
1 parent
c26c36d
commit 4a63c70
Showing
3 changed files
with
36 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Teemu's original draft, slightly edited | ||
# we keep this around since it gives a hint how the interface can be | ||
# extended to support named tuples. | ||
# | ||
# macro withalloc(ex) | ||
# # Create symbols based on imput | ||
# out_obj = Symbol( "out_" * String(ex.args[2]) ) | ||
# out_obj_info = Symbol( "out_" * String(ex.args[2]) * "_info" ) | ||
|
||
# # Create expressions | ||
# # out_obj_info = whatalloc(somecalculation!, x1, x2, ...) | ||
# l1 = Expr(:call, :(=), out_obj_info, Expr(:call, :whatalloc, ex.args...) ) | ||
|
||
|
||
# # A = @alloc(out_obj_info.A...) | ||
# # la = Expr(:(=), :A, Expr(:macrocall, Symbol("@alloc"), Symbol("# empty #"), Expr(:..., Expr(:., out_obj_info, :(:A))) ) ) | ||
|
||
# # B = @alloc(out_obj_info.B...) | ||
# # lb = Expr(:(=), :B, Expr(:macrocall, Symbol("@alloc"), Symbol("# empty #"), Expr(:..., Expr(:., out_obj_info, :(:B))) ) ) | ||
|
||
# # out_obj = (A = @alloc(out_obj_info.A...), B = @alloc(out_obj_info.B...) ) | ||
# l2 = Expr(:(=), out_obj, Expr(:tuple, la, lb) ) | ||
# l3 = Expr(:call, out_obj, ex.args... ) | ||
|
||
# # Create the final expression | ||
# q = quote | ||
# $l1 | ||
# $l2 | ||
# $l3 | ||
# end | ||
# end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters