`isdef`with `quote` seems giving incorrect result
- Dominant language
- Julia
- Stars
- 320
- Forks
- 84
- PR merge metrics
- No merged PRs in 30d
Description
I need to convert a mathematical function in a string into Julia lambda function.
Just found the package, it seems very useful.
Just stumbled by a very basic example: `expr = :(x -> x + 2)` is recognized as a function by `isdef`, while `quote x -> x + 2 end` is not recognized.
MWE
```julia
julia> expr = quote
x -> x + 2
end
julia> MacroTools.isdef(expr)
false
julia> eval(expr)(3)
5
```
julia v1.10
MacroTools v0.5.13
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the MWE with Julia 1.10 and inspect MacroTools.isdef on both the direct lambda expression and the quote-wrapped expression. Compare the two expression shapes and add regression coverage so the intended isdef result for the quoted lambda is explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100