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

Reorder methods after new implications are added #2773

Merged
merged 2 commits into from
Sep 14, 2018

Commits on Sep 12, 2018

  1. Reorder methods after new implications are added

    Many GAP methods get rank adjustments based on the rank of some filter,
    e.g, `RankFilter(IsAbelian)`. However, these ranks may change when new
    implications are added, e.g. when certain packages are loaded. But those
    method rank adjustments then won't be updated, which can ultimately lead
    to the effect that loading a package changes which methods get executed
    in otherwise identical code.
    
    This PR helps avoid that, by making it possible to set "dynamic" rank
    adjustments which get updated as new implications are added. Some cleverness
    is needed to make this work efficiently when loading packages.
    
    - Record rank adjustment in METHODS_OPERATION
    - Add RECALCULATE_ALL_METHOD_RANKS function which does what it says.
    - Adjust MethodsOperation to include base rank
    - Increase size of HIDDEN_IMPS_CACHE and WITH_IMPS_CACHE to speed up RECALCULATE_ALL_METHOD_RANKS()
    - Make sure RANK_FILTERS is always set promptly, then remove the test for it being unset
      in RankFilter
    - Automatically reorder methods after library or package loading, or InstallTrueMethod
    - Use COPY_LIST_ENTRIES in method installation to avoid making an intermediate list
    - Support passing a function of no arguments as the rank adjustment to InstallMethod
    - Reset reordering status on quit from break loop.
    
    Fixes gap-system#2513
    stevelinton authored and fingolfin committed Sep 12, 2018
    Configuration menu
    Copy the full SHA
    17d1bac View commit details
    Browse the repository at this point in the history
  2. Adjust InstallMethod calls depending on RankFilter

    ... to use a rank *function* instead of a single fixed rank value.
    fingolfin committed Sep 12, 2018
    Configuration menu
    Copy the full SHA
    1e725c2 View commit details
    Browse the repository at this point in the history