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

declarations of functions with several integer arguments are suboptimal #18

Closed
jmichel7 opened this issue Nov 21, 2024 · 6 comments
Closed

Comments

@jmichel7
Copy link
Contributor

The declaration for a function like wmove is

wmove(win::Ptr{WINDOW}, y::T, x::T) where T<:Integer

This is not very convenient. For example a call like

wmove(win,getbegy(win),10)

gives "method not found" because getbegy is Int32 while 10 is Int64. It would be better in similar cases to have

wmove(win::Ptr{WINDOW}, y::T1, x::T2) where {T1<:Integer,T2<:Integer}

or

wmove(win::Ptr{WINDOW}, y::Integer, x::Integer)

I did not make a pull request because I have not yet fully understood your automatic way to port functions.

@ronisbr
Copy link
Owner

ronisbr commented Nov 26, 2024

Perfect! You are completely right. I fully agree with this approach. I am just not sure what is the best way to implement it.

@ronisbr
Copy link
Owner

ronisbr commented Nov 27, 2024

Done!

This approach was used in an old Julia version to make the precompilation more effective. The current version is way better handling those cases and I simplified a lot. Can you please test before I tag a new version?

@jmichel7
Copy link
Contributor Author

I cannot compile TextUserInterfaces with you current master. The error message I get begins with

Failed to precompile TextUserInterfaces [2a09ff82-1be9-11e9-2ab7-19964783a84b] to "/home/jmichel/.julia/compiled/v1.11/TextUserInterfaces/jl_4VHfDD".
ERROR: LoadError: could not load symbol "initscr":
/home/jmichel/julia-1.11.1/bin/julia: undefined symbol: initscr
Stacktrace:
  [1] initscr
    @ ~/.julia/dev/TextUserInterfaces/src/submodules/NCurses/ncurses_functions.jl:637 [inlined]
  [2] initialize_tui()
    @ TextUserInterfaces ~/.julia/dev/TextUserInterfaces/src/initialization.jl:20
  [3] macro expansion

@ronisbr
Copy link
Owner

ronisbr commented Nov 27, 2024

Oops, can you please test again?

@jmichel7
Copy link
Contributor Author

My app works fine again. Everything I tried works and the prototypes of the Curses functions are nicer now.

@ronisbr
Copy link
Owner

ronisbr commented Nov 28, 2024

Awesome!

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

No branches or pull requests

2 participants