c: ClosureData, GoClosure
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4
- Forks
- 7
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 3
Description
spec:
package c
func ClosureData[ClosureT any](closure ClosureT) Pointer
func GoClosure[ClosureT any](data Pointer) (closure ClosureT)
example:
// VisitChildren visits the children of a particular cursor, invoking the given
// visitor function for each child cursor. The traversal may be recursive,
// depending on the return value of the visitor function.
func VisitChildren(root Cursor, fn func(cur, parent Cursor) ChildVisitResult) uint {
return uint(clang.VisitChildren(
root, func(cur, parent Cursor, param clang.ClientData) ChildVisitResult {
return c.GoClosure[func(cur, parent Cursor) ChildVisitResult](param)(cur, parent)
}, c.ClosureData(fn)))
}
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
The issue specifies new ClosureData and GoClosure APIs in the c package, with a VisitChildren example showing the intended callback flow. Start by locating the c package and existing Pointer-related APIs; done means the two generic functions support the shown callback usage and the example can pass a Go closure through ClientData.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100