defcfn: set :arglists from the argtypes
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- developer-experience
Research direction
Start with the defcfn macro, comparing the plain form, which defines a var without :arglists, against the wrapper form, which already sets them from its fn tail. Derive :arglists from the argtypes in the plain form, following the issue's examples such as ([arg0]) and ([arg0 arg1 & args]), and let an :arglists key in the attribute map override it. Done when (:arglists (meta #'c-abs)) and (:arglists (meta #'c-open)) return the expected vectors and the existing tests still pass.
Written by the indexing model from the issue text.
Description
The plain form of defcfn defines a var without :arglists, so doc, eldoc and completion show no argument list:
(ffi/defcfn c-abs "abs" [:int] :int)
(:arglists (meta #'c-abs)) ;;=> nil
(ffi/defcfn c-open "open" [:string :int :&] :int)
(:arglists (meta #'c-open)) ;;=> nil
The wrapper form has them, from its fn tail.
defcfn could derive :arglists from the argtypes, for example ([arg0]) and ([arg0 arg1 & args]). An :arglists in the attribute map would take precedence.
- Dominant language
- Clojure
- Stars
- 25
- Forks
- 3
- Avg merge
- 1m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from babashka/ffi
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nextjournal/clerk#830 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
penpot/penpot#13540 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100