Skip to content

show: print var"ccall" correctly #59248

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

Closed
wants to merge 1 commit into from
Closed

Conversation

aviatesk
Copy link
Member

@aviatesk aviatesk commented Aug 10, 2025

No description provided.

@aviatesk aviatesk force-pushed the avi/ccall-var-print branch from ea8d204 to ffe50e9 Compare August 10, 2025 21:23
@Keno
Copy link
Member

Keno commented Aug 11, 2025

Does lowering actually understand this as a keyword:

julia> var"ccall" = 1
ERROR: syntax: invalid assignment location "ccall" around REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1

julia> var"ccall"(:time, Csize_t, (Ptr{Csize_t},), C_NULL)
0x0000000068994f23

I don't think there's any parse difference between ccall and var"ccall. Possibly there should be, but as long as there isn't, this seems incorrect.

@aviatesk
Copy link
Member Author

Right... I hadn't noticed that. I did some investigation with Claude, but for the following reasons, I think we should close this PR for now.


Supporting var"ccall" and var"cglobal" would require threading metadata through the parser to distinguish symbols created via var"" syntax from bare symbols, since valid-name? currently rejects both unconditionally, and the special-case handling in julia-syntax.scm for ccall in function position relies on simple symbol equality checks that would need refactoring to handle the distinction. Given that these intrinsics are rarely needed as variable names and the implementation would require non-trivial changes to both the Scheme-based parser and lowering passes, the cost-benefit ratio doesn't justify the added complexity.

@aviatesk aviatesk closed this Aug 13, 2025
@aviatesk aviatesk deleted the avi/ccall-var-print branch August 13, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants