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

Fix TAB completion for e.g. 'GAP.Globals.MTX.S' in Julia >= 1.11 #969

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/ccalls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import Base: getproperty, hasproperty, setproperty!, propertynames
#
# low-level GAP -> Julia conversion
#
Compat.@assume_effects :effect_free :terminates_globally function _GAP_TO_JULIA(ptr::Ptr{Cvoid})
# The 'assume_effects' is needed for tab completion of "nested" constructs,
# e.g. when entering `GAP.Globals.MTX.S` on the REPL then pressing TAB.
Compat.@assume_effects :foldable !:consistent function _GAP_TO_JULIA(ptr::Ptr{Cvoid})
ptr == C_NULL && return nothing
# convert immediate ints and FFEs directly, to avoid (un)boxing
as_int = reinterpret(Int, ptr)
Expand Down Expand Up @@ -157,7 +159,10 @@ end

# Retrieve the value of a global GAP variable given its name. This function
# returns a raw Ptr value, and should only be called by plumbing code.
Compat.@assume_effects :effect_free :terminates_globally function _ValueGlobalVariable(name::Union{AbstractString,Symbol})
#
# The 'assume_effects' is needed for tab completion of "nested" constructs,
# e.g. when entering `GAP.Globals.MTX.S` on the REPL then pressing TAB.
Compat.@assume_effects :foldable !:consistent function _ValueGlobalVariable(name::Union{AbstractString,Symbol})
return ccall((:GAP_ValueGlobalVariable, libgap), Ptr{Cvoid}, (Cstring,), name)
end

Expand Down
Loading