System Command SYMB

From NARS2000
Revision as of 20:37, 13 October 2019 by Paul Robinson (talk | contribs) (t/c)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The )SYMB command displays the maximum, current and in use settings of the Symbol and Hash tables of the active workspace. These values are useful to know in case you encounter a SYMBOL TABLE FULL or HASH TABLE FULL error message. For example, in the 64-bit version of NARS2000, you might see the following display:

             Maximum       # × Units   Current    In Use  Command Line Switch w/Default
GlbSymTab:    262144 (   256 × 1024)      4276       178  -GlbSymTabSize=256
GlbHshTab:   2097152 (   256 × 8192)    131072       178  -GlbHshTabSize=256
AFOSymTab:       256 (   256 ×    1)                      -AFOSymTabSize=256
AFOHshTab:      2048 (   256 ×    8)                      -AFOHshTabSize=256

A Symbol Table is used for all named objects as well as small numeric and character scalar constants. A Hash Table is used to find a Symbol Table Entry (STE) efficiently.

Each workspace has two kinds of Symbol Tables and two kinds of Hash Tables. The first kind is the Global table used by variables, functions, and operators — this is the one used most heavily and can be quite large. The second kind is used inside Anonymous Functions and Operators (AFOs) — this one is used much more sparingly and is much smaller as it is limited to just the symbols present inside the AFO. Each AFO has its own private Symbol and Hash Table.

Both kinds of Tables are limited exhaustible resources. As the above table shows, the default Symbol Table has a maximum # STEs of 262,144 ←→ 256×1024 and a maximum # Hash Table Entries (HTEs) of 2,097,152 ←→ 256×8192. These entries do not consume RAM as they are allocated from Uncommitted Memory which allocates address space but does not back it up with any RAM. The Current column indicates the # entries backed up with RAM and the In Use column indicates the # entries used by existing STEs or HTEs. When the # In Use entries reaches the # Current entries, more RAM is allocated. When the # Current entries reaches the # Maximum entries, the appropriate TABLE FULL error is signaled.

When that occurs, you need to increase the size of one or more of the tables. First, clear the State Indicator with )RESET, )SAVE the workspace, and display the Symbol and Hash Table settings using the )SYMB system command. Use those results to decide which of the tables needs to be increased (typically where Maximum = Current). Then, exit the NARS2000 interpreter and restart it with one or more of the Switches on the command line to NARS2000.exe. For example, if the Symbol Table is too small for your purposes, start the interpreter with (perhaps) NARS2000.exe -GlbSymTabSize=512. As Windows removes the equal sign from the line that invokes a batch file, NARS2000 also accepts an alternative syntax using a colon in place of the equal sign, as in NARS2000.exe -GlbSymTabSize:512.

System Commands (not case sensitive)

See Also
System Commands System Variables and Functions Operators

Alt ¨ ¯ < > × ÷
Sh ~ ! @ # $ % ^ & * ( ) _ +
Key ` 1 2 3 4 5 6 7 8 9 0 - =
Alt ? § π
Sh Q W E R T Y U I O P { } |
Key q w e r t y u i o p [ ] \
Sh A S D F G H J K L : "
Key a s d f g h j k l ; '
A+S χ
Sh Z X C V B N M < > ?
Key z x c v b n m , . /
NARS 2000 Lang
+ - × ÷ * ! ? |
< = >
~ § π .. ,
/ \ ¨ .
_ ¯
Second Row i j k i j k l g p r v x