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

Deduplicate identical entries in "code methods X" #3388

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

mahrud
Copy link
Member

@mahrud mahrud commented Aug 5, 2024

Before:

o1 = -- code for method: toList(BasicList)
     function toList1: source code not available
     ---------------------------------------------------------------------------
     -- code for method: toList(Set)
     function toList1: source code not available
     ---------------------------------------------------------------------------
     -- code for method: toList(String)
     function toList1: source code not available
     ---------------------------------------------------------------------------
     -- code for method: toList(Thing)
     ../linuxbrew/.linuxbrew/share/Macaulay2/Core/iterators.m2:28:18-28:37:
     --source code:
     toList Thing := x -> for y in x list y

After:

o1 = -- code for method: toList(Thing)
     ../../../../feature/M2/Macaulay2/m2/iterators.m2:29:18-29:37:
     toList Thing := x -> for y in x list y
     ------------------------------------------------------------------------------------------------------------------------
     -- code for method: toList(String)
     -- code for method: toList(BasicList)
     -- code for method: toList(Set)
     compiled function toList1: source code not available

Also sorts the methods by location, rather than name:

i3 : locate methods(map, Module, List)

o3 = {0 => (../../../../feature/M2/Macaulay2/m2/matrix1.m2:93:45-157:10) }
     {1 => (../../../../feature/M2/Macaulay2/m2/matrix1.m2:93:45-157:10) }
     {2 => (../../../../feature/M2/Macaulay2/m2/matrix1.m2:93:45-157:10) }
     {3 => (../../../../feature/M2/Macaulay2/m2/ringmap.m2:568:47-568:94)}
     {4 => (../../../../feature/M2/Macaulay2/m2/ringmap.m2:569:48-569:84)}

Closes #3364.

@mahrud mahrud force-pushed the quickfix/methods branch 2 times, most recently from db2d47d to 17d2bc4 Compare August 5, 2024 12:10
@mahrud
Copy link
Member Author

mahrud commented Aug 5, 2024

Interesting, I think this failure means the hashes of autotools and cmake builds are different.

@mahrud mahrud force-pushed the quickfix/methods branch 2 times, most recently from 03437a3 to 725719d Compare August 5, 2024 15:59
@d-torrance
Copy link
Member

Interesting, I think this failure means the hashes of autotools and cmake builds are different.

What happened?

@mahrud
Copy link
Member Author

mahrud commented Aug 6, 2024

What happened?

This failed with CMake but not on Autotools:

i81 : s = code methods u

o81 = -- code for method: u(Matrix)
      -- code for method: u(Number)
      compiled function identity: source code not available

i82 : assert(net s#0#0 == "-- code for method: u(Number)")

Presumably because on Autotools Matrix and Number lines above are flipped :)

@d-torrance
Copy link
Member

I don't think it's an autotools v. cmake thing, but just that the hash of the method function u depends on its address in memory after #2934.

@d-torrance d-torrance merged commit 464005e into Macaulay2:development Aug 8, 2024
5 checks passed
@mahrud mahrud deleted the quickfix/methods branch August 11, 2024 23:27
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.

"code methods" should deduplicate entries
2 participants