next | previous | forward | backward | up | top | index | toc | home

code -- display source code

Description

code f -- prints out the source code of the function or commandf.
code(f,X) -- prints out the source code of the particular method that would be applied if f were applied to an argument of class X.
code(f,X,Y) -- prints out the source code of the particular method that would be applied if f were applied to arguments of classes X and Y.
code(f,X,Y,Z) -- prints out the source code of the particular method that would be applied if f were applied to arguments of classes X, Y, and Z.
code {v,w,...} -- prints out the source code for each of the items listed.

i1 : code methods use

o1 = -- code for method: use(Thing)
     function 'identity': source code not available
     ---------------------------------
     -- code for method: use(Ring)
     -- ../../../../Macaulay2/m2/enginering.m2:220-225
     use Ring := R -> (
          if R.?ring then use R.ring;                            -- I'm not sure what this is for.  Which rings have this key?
          generators R;
          if R.?generators and R.?generatorSymbols then scan(R.generatorSymbols,R.generators,(sym,val) -> sym <- val);
          if R.?use then R.use R;
          R)
     ---------------------------------
     -- code for method: use(Monoid)
     -- ../../../../Macaulay2/m2/orderedmonoidrings.m2:7
     use Monoid := x -> ( if x.?use then x.use x; x)
     ---------------------------------
     -- code for method: use(Package)
     -- ../../../../Macaulay2/m2/packages.m2:295-298
     use Package := pkg -> if not member(pkg,loadedPackages) then (
          loadedPackages = prepend(pkg,loadedPackages);
          dictionaryPath = prepend(pkg.Dictionary,dictionaryPath);
          )

See also