Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » debugging » code
next | previous | forward | backward | up | index | toc

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 = ../../../../Macaulay2/m2/debugging.m2:198:28-198:64: --source code:
     listUserSymbols = Command ( type -> listSymbols userSymbols type )

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)
     ../../../../Macaulay2/packages/OldChainComplexes/res.m2:283:37-283:78:
     --source code:
     resolution Ideal  := ChainComplex => opts -> I -> resolution(comodule I, opts)

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
     ../../../../Macaulay2/packages/Saturation.m2:148:51-148:75: --source
     code:
     Ideal  : Ideal                := Ideal  =>         (I, J) -> quotient(I, J)

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, 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(Ring)
     ../../../../Macaulay2/m2/enginering.m2:384:12-389:7: --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(Monoid)
     ../../../../Macaulay2/m2/monoids.m2:193:21-193:56: --source code:
     use        Monoid := M ->(if M.?use     then M.use M; M)
     ------------------------------------------------------------------------
     -- code for method: use(Package)
     ../../../../Macaulay2/m2/packages.m2:536:15-541:42: --source code:
     use Package := pkg -> (
         scan(nonnull pkg.Options.PackageExports, needsPackage);
         loadedPackages = prepend(pkg,            delete(pkg,            loadedPackages));
         dictionaryPath = prepend(pkg.Dictionary, delete(pkg.Dictionary, dictionaryPath));
         checkShadow();
         if pkg.?use then pkg.use pkg else pkg)
     ------------------------------------------------------------------------
     -- code for method: use(Thing)
     compiled function identity:  source code not available

See also

Ways to use code:

  • code(Command)
  • code(Function)
  • code(List)
  • code(Pseudocode)
  • code(Sequence)
  • code(Symbol)
  • code(ZZ)
  • code(FilePosition) (missing documentation)
  • code(TestInput) -- see tests -- locate a package's tests

For the programmer

The object code is a method function with a single argument.


The source of this document is in Macaulay2Doc/ov_debugging.m2:619:0.