Skip to content

Base.CFunction is user-visible but undocumented #27490

@stevengj

Description

@stevengj

#26486 introduced a struct CFunction in Base that is returned by @cfunction for interpolated function arguments:

julia> @cfunction $sin Float64 (Float64,)
Base.CFunction(Ptr{Nothing} @0x0000000116262a90, sin, Ptr{Nothing} @0x0000000000000000, Ptr{Nothing} @0x0000000000000000)

Although this type is user-visible, it is currently undocumented (both in the @cfunction docs and because it lacks a docstring).

CFunction has an unsafe_convert method to Ptr{Cvoid}, so it can be passed as a callback argument. (But CFunction doesn't work with ccall!) But users still need to know about the type — e.g. in PyCall I have to store it in a struct.

(Should this type be exported?)

Metadata

Metadata

Assignees

Labels

docsThis change adds or pertains to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions