Skip to content

Commit

Permalink
Fix name of curried function (it's not an expression)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-arya committed Aug 21, 2023
1 parent b35f261 commit 1a95cc8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compact.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ end

function supportself(fex::Expr, vars)
@gensym self
@gensym curried_fex
@gensym curried_f
# To avoid having to manipulate fex's arguments and body explicitly, we form a curried function first
# that wraps the full fex expression, and then uncurry it programatically rather than syntactically.
let_exprs = map(var -> :($var = $self.$var), vars)
return quote
$curried_fex = ($self) -> let $(let_exprs...)
$curried_f = ($self) -> let $(let_exprs...)
$fex
end
($self, args...; kwargs...) -> $curried_fex($self)(args...; kwargs...)
($self, args...; kwargs...) -> $curried_f($self)(args...; kwargs...)
end
end

Expand Down

0 comments on commit 1a95cc8

Please sign in to comment.