Skip to content

Commit

Permalink
Merge pull request #21 from awesome-spectral-indices/fm/fix
Browse files Browse the repository at this point in the history
Fixing _build_function
  • Loading branch information
MartinuzziFrancesco authored Jan 17, 2024
2 parents 4d3baa9 + 5bff23f commit 16cbeb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ function parse_eval_dict(ex::AbstractString, locals::Dict)
)
end

#=
function _build_function(name::String, expr::Expr, args::Symbol...)
function_name = Symbol(name, args...)
inner_function_expr = quote
Expand All @@ -175,6 +176,11 @@ function _build_function(name::String, expr::Expr, args::Symbol...)
return eval(function_name)
end
=#

function _build_function(name::String, expr::Expr, args::Symbol...)
return eval(:(($(args...),) -> $expr))
end

function _create_params(kw_args...)
params = Dict(String(k) => v for (k, v) in kw_args)
Expand Down

0 comments on commit 16cbeb9

Please sign in to comment.