*MAX-RECURSION-STACK*, *MAX-ARGS-LIMIT*


Synopsis

Constants: *MAX-RECURSION-STACK*, *MAX-ARGS-LIMIT*

Value Type:

A non-negative integer number.

Initial Value:

Calculated at initialization time within (stdlib-project-init) or (std-%top-level-1) at STDINIT2.LSP

Description

*MAX-RECURSION-STACK* specifies the allowed stack size. You may normally safely recurse into lists which are are shorter than this number. Longer lists must be processed iteratively or splitted into shorter parts.

This value is useful for custom recursive function.

Error Severity with Stack Overflows

Stack overflows may produce soft, hard errors or the sudden death.

AutoLISP: soft error, calls (*error* "stack-overflow")

VL: hard error, it aborts the whole evaluation. Any custom *error* is not called.

FCAD: immediate death, FCAD crashes immediately

*MAX-ARGS-LIMIT* specifies the maximal number of arguments to a system function which takes an "infinite" number of optional arguments, specified by three dots ... in the description.

Be sure not to apply longer lists to any of these functions.

Error Severity with too many arguments

"too many arguments" errors may produce soft, hard errors or the sudden death.

AutoLISP: soft error, calls (*error* "too many arguments")

VL: hard error, it aborts the whole evaluation. Any custom *error* handler is not called.

FCAD: slow death, FCAD 4 will eat up a lot of memory, (>100MB) until the system memory is exhausted. This will make it even impossible to kill the application because there's not enough memory to call the task manager, or to redraw any window.
A workable number is between 1000 and 3000 arguments.

Definition

Missing:

   Intellicad, TurboCAD, r12/win (240 assumed),
   <10.10 (138 assumed, but special LISPSTACK env variable),
      extended lisp settings not checked with (getenv)
   acomp r10 (1240 assumed, but special compstack env variable)
      currently not check with (getenv)

Errors:

    AutoLISP: a soft error, calls (*error* "stack-overflow")
    VL: a hard error, it aborts the whole evaluation. 
       Any Custom *error is not called
    FCAD: death, FCAD crashes immediately

*MAX-RECURSION-STACK*:

    (cond
      ((and (std-vl-p) (std-vlide-p)) 984); VL IDE: simulated,977?
      ((std-vl-p) *MAX-SHORTINT*)	; VL RTS: unlimited
      ((std-acomp-p) 1240)	; acomp (see above)

((std-ver-fcad-p) 1984) ; then FCAD.EXE dies!

      ((= (_ver) "i7.00r") 251)	; r13
      ((= (_ver) "i8.00r") 239)	; r14
      ((and (std-ver-win-p)
            (< (std-ver-num) 15)) 240) 	; r12/13/14 win
      ((< (std-ver-num) 13) 138)	; r12/dos
      (T 200)	; ?? (unreachable code)
      ))

Maximal number of arguments to functions like AND
=> (*error* "too many arguments") in AutoLISP

*MAX-ARGS-LIMIT*:

    (cond
      ((std-ver-r2000-p) 1623)	; not checked with FCS
      ((std-vl-p) 32767)
      ((std-acomp-p) 32)	; acomp
      ((std-ver-fcad-p) 2000) 	; even more, but 3000 needs
; 100MB heap space and a few
; minutes ((std-ver-win-p) 1000) ; r12/13/14 win (T 65534) ))

Module

Defined in STDINIT2.

Called in (std-%top-level-1) which is called either after having loaded STDFILE if *STD:%PROJECT* is not set or otherwise called by the user initialization function (stdlib-project-init)