Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JLFunction does not support x -> x #69

Closed
josephmckinsey opened this issue Aug 14, 2023 · 2 comments · Fixed by #76
Closed

JLFunction does not support x -> x #69

josephmckinsey opened this issue Aug 14, 2023 · 2 comments · Fixed by #76
Labels
bug Something isn't working

Comments

@josephmckinsey
Copy link

Using [6b7a57c9] Expronicon v0.10.3 on Julia 1.9.0, JLFunction cannot construct a function from an anonymous function with only one input. Somewhat strangely, JLFunction(:((x, y) -> x)) does work.

julia> using Expronicon

julia> JLFunction(:(x -> x))
ERROR: MethodError: no method matching split_function_head(::Symbol; source::Nothing)

Closest candidates are:
  split_function_head(::Expr; source)
   @ Expronicon ~/.julia/packages/Expronicon/7EBrJ/src/analysis/split.jl:43

Stacktrace:
 [1] JLFunction(ex::Expr; source::Nothing)
   @ Expronicon ~/.julia/packages/Expronicon/7EBrJ/src/analysis/cons.jl:30
 [2] JLFunction(ex::Expr)
   @ Expronicon ~/.julia/packages/Expronicon/7EBrJ/src/analysis/cons.jl:16
 [3] top-level scope
   @ REPL[2]:1

This probably just needs split_function_head to have a new case for symbol, maybe.

@0x0f0f0f
Copy link
Contributor

Oh, this was fixed by #71

@josephmckinsey
Copy link
Author

Cool. Nice to see the case ::Int -> 0 I didn't even know about covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants