next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: code

code -- display source code

Description

Synopsis

  • Usage:
    code f
  • Inputs:
  • Outputs:
    • a net, the source code of the function or commandf
i1 : code listUserSymbols

o1 = /builddir/build/BUILD/Macaulay2-1.6-
     listUserSymbols = Command ( type -> 
     ------------------------------------------------------------------------
     77124166d123caab69ac4655d15b6bfab3e74496/M2/Macaulay2/m2/debugging.m2:
     listSymbols userSymbols type )
     ------------------------------------------------------------------------
     198:34-198:61: --source code:

Synopsis

  • Usage:
    code(f,X)
  • Inputs:
  • Outputs:
    • a net, the source code of method for applying f to an argument of type X
i2 : code(res,Ideal)

o2 = -- code for method: resolution(Ideal)
     /builddir/build/BUILD/Macaulay2-1.6-77124166d123caab69ac4655d15b6bfab3e74496/M2/Macaulay2/m2/res.m2:214:45-218:6: --source code:
     resolution Ideal := ChainComplex => options -> (I) -> resolution(
          if I.cache.?quotient 
          then I.cache.quotient
          else I.cache.quotient = (ring I)^1/I,
          options)

Synopsis

  • Usage:
    code(f,X,Y)
  • Inputs:
  • Outputs:
    • a net, the source code of method for applying f to arguments of type X and Y
i3 : code(symbol :, Ideal, Ideal)

o3 = -- code for method: Ideal : Ideal
     /builddir/build/BUILD/Macaulay2-1.6
     Ideal : Ideal := Ideal => (I,J) -> 
     ------------------------------------------------------------------------
     -77124166d123caab69ac4655d15b6bfab3e74496/M2/Macaulay2/m2/colon.m2:162:
     quotient(I,J)
     ------------------------------------------------------------------------
     33-162:47: --source code:

Synopsis

  • Usage:
    code(f,X,Y,Z)
  • Inputs:
  • Outputs:
    • a net, the source code of method for applying f to arguments of type X, Y, and Z

Synopsis

  • Usage:
    code(f,X,Y,Z,T)
  • Inputs:
  • Outputs:
    • a net, the source code of method for applying f to arguments of type X, Y, and Z, and T

Synopsis

  • Usage:
    code {v,w,...}
  • Inputs:
  • Outputs:
    • a net, the source code of the functions or commandsv,w,.... Such a list can be obtained, for example, with methods.
i4 : code methods use

o4 = -- code for method: use(Monoid)
     /builddir/build/BUILD/Macaulay2-1.6-77124166d123caab69ac4655d15b6bfab3e74496/M2/Macaulay2/m2/orderedmonoidrings.m2:7:17-7:46: --source code:
     use Monoid := x -> ( if x.?use then x.use x; x)
     ---------------------------------
     -- code for method: use(Package)
     /builddir/build/BUILD/Macaulay2-1.6-77124166d123caab69ac4655d15b6bfab3e74496/M2/Macaulay2/m2/packages.m2:453:20-466:31: --source code:
     use Package := pkg -> (
          a := member(pkg,loadedPackages);
          b := member(pkg.Dictionary,dictionaryPath);
          if a and not b then error("use: package ",toString pkg," appears in loadedPackages, but its dictionary is missing from dictionaryPath");
          if b and not a then error("use: package ",toString pkg," does not appear in loadedPackages, but its dictionary appears in dictionaryPath");
          if not a and not b then (
               scan(pkg.Options.PackageExports, needsPackage);
               loadedPackages = prepend(pkg,loadedPackages);
               --- if mutable pkg.Dictionary then error("package ", toString pkg, " not completely loaded yet");
               dictionaryPath = prepend(pkg.Dictionary,dictionaryPath);
               checkShadow();
               );
          if pkg.?use then pkg.use pkg;
          )
     ---------------------------------
     -- code for method: use(Ring)
     /builddir/build/BUILD/Macaulay2-1.6-77124166d123caab69ac4655d15b6bfab3e74496/M2/Macaulay2/m2/enginering.m2:324:15-329:6: --source code:
     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(Thing)
     function 'identity': source code not available