Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » debugging » debug » debug(String)
next | previous | forward | backward | up | index | toc

# debug(String) -- open the local dictionary of a loaded file

- Function: debug
- Usage:
    `debug filename`
- Inputs:
  - filename, a string,
- Consequences:
  - symbols from the local dictionary fileDictionaries#filename are added to the private dictionary of User, and are therefore made visible to the user

## Description

This function allows access to the local symbols of a any loaded file.

    i1 : load "Macaulay2Doc/demos/demo1.m2"

    i2 : listUserSymbols

    o2 = symbol  class            value  location of symbol
         ------  -----            -----  ------------------
         g       FunctionClosure  g      /usr/share/Macaulay2/
                                         Macaulay2Doc/demos/demo1.m2:11:0-11:1

    i3 : debug "Macaulay2Doc/demos/demo1.m2"
    stdio:3:5:(3): error: key not found in hash table:
            "Macaulay2Doc/demos/demo1.m2" (of class String)

    i4 : listUserSymbols

    o4 = symbol  class            value  location of symbol
         ------  -----            -----  ------------------
         g       FunctionClosure  g      /usr/share/Macaulay2/
                                         Macaulay2Doc/demos/demo1.m2:11:0-11:1

    i5 : code f
    stdio:5:4:(3): error: line number 1 not found in file stdio

## See also

- fileDictionaries -- local dictionaries for loaded files
- debug(Package) -- open the private dictionary of a package
- debug(LocalDictionary) -- open a local or global dictionary to the user
- debug(GlobalDictionary) -- open a local or global dictionary to the user

## Ways to use this method:

- debug(String) -- open the local dictionary of a loaded file

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