Skip to content

Define methodOptions(List)#4120

Open
d-torrance wants to merge 1 commit intoMacaulay2:developmentfrom
d-torrance:method-options-list
Open

Define methodOptions(List)#4120
d-torrance wants to merge 1 commit intoMacaulay2:developmentfrom
d-torrance:method-options-list

Conversation

@d-torrance
Copy link
Member

This fixes an error when calling code on a method installed using a list as a key, e.g., {Standard, Print}.

Before

i1 : code methods {Standard, Print}
stdio:1:4:(3): error: no method found for applying methodOptions to:
     argument   :  {Standard, Print} (of class List)

After

i3 : code methods {Standard, Print}

o3 = -- code for method: {Standard, Print}(InexactNumber)
     /usr/share/Macaulay2/Core/reals.m2:447:33-447:91: --source code:
     InexactNumber#{Standard,Print} = x ->  withFullPrecision ( () -> Thing#{Standard,Print} x )
     ------------------------------------------------------------------------------------------
     -- code for method: {Standard, Print}(Thing)
     /usr/share/Macaulay2/Core/robust.m2:133:25-149:6: --source code:
     Thing#{Standard,Print} = x -> (
          oprompt := concatenate(interpreterDepth:"o", toString lineNumber, " = ");
          save := printWidth;
          if printWidth != 0 then printWidth = printWidth - #oprompt;
          z := robustNet x;
          wrapper := lookup(global Wrap,class x);
          if wrapper =!= null then (
               fun := () -> z = wrapper z;
               try timelimit(printingTimeLimit, fun)
               else (
                    alarm 0;
                    global debugError <- fun;
                    stderr << "--error or time limit reached in applying Wrap method to output; type 'debugError()' to see it" << endl << endl);
               );
          << endl << oprompt << z << endl;
          printWidth = save;
          )
     ------------------------------------------------------------------------------------------
     -- code for method: {Standard, Print}(Nothing)
     compiled function identity:  source code not available

This fixes an error when calling "code" on a method installed using a
list as a key, e.g., {Standard, Print}.
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.

1 participant