Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » packages » importFrom
next | previous | forward | backward | up | index | toc

# importFrom -- import symbols to the current private dictionary

- Usage:
    `importFrom(pkg, {"symbol1", "symbol2"})`
- Inputs:
  - pkg, a package or a string, the package containing the private symbols
  - a string or a list, of strings, corresponding to the private symbols to export from the package
- Outputs:
  - a list, of symbols
- Consequences:
  - package symbols provided in the list will be added to the private dictionary of the current package, but will not be exported

## Description

This function can be used to import specific symbols from the private dictionary of another package into the private dictionary of the current package.

    i1 : importFrom_Core {"raw"}

    o1 = {raw}

    o1 : List

    i2 : raw random(ZZ^2, ZZ^2)

    o2 = 8 3
         1 7

    o2 : RawMatrix

To import all private symbols of a package, use debug(Package) instead. The symbols imported with this function can then be exported using export or exportMutable.

## See also

- debug(Package) -- open the private dictionary of a package
- exportFrom -- export symbols from a package's private dictionary
- Dictionary -- the class of all dictionaries

## Ways to use importFrom:

- `importFrom(Package,List)`
- `importFrom(Package,String)`
- `importFrom(String,List)`
- `importFrom(String,String)`

## For the programmer

The object importFrom is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/export-doc.m2:140:0.