Tcl_SetRecursionLimit(3tcl)
β¨ Tcl_SetRecursionLimit β¨
okay bestie, welcome to the Tcl Library Procedures corner of the man pages π
this one is Tcl_SetRecursionLimit(3tcl) and it's literally about how deep your interpreter is allowed to go before Tcl is like "girl. stop." π
πΈ NAME πΈ
Tcl_SetRecursionLimit β set maximum allowable nesting depth in interpreter π
π SYNOPSIS π
#include <tcl.h>
Tcl_Size
Tcl_SetRecursionLimit(interp, depth)
π ARGUMENTS π
Tcl_Interp *interp(in) β the interpreter whose recursion limit you're setting, bestie. and no, it Must be greater than zero, so don't even try it with a null-ish nothing. πTcl_Size depth(in) β the new limit for nested calls toTcl_Evalfor interp. that's the number, the whole number, nothing but the number. π’
π¦ DESCRIPTION π¦
so here's the tea β β at any given time, Tcl enforces a limit on the number of recursive calls that may be active for Tcl_Eval and related procedures such as Tcl_EvalEx. any call to Tcl_Eval that exceeds this depth gets aborted with an error. no mercy, no vibes, just error. π and the default? the recursion limit is 1000. iconic number, honestly.
Tcl_SetRecursionLimit is your girl for changing the maximum allowable nesting depth for an interpreter. you hand it a depth argument, it specifies a new limit for interp, and it returns the old limit β like a little souvenir from before you changed everything. π«Ά
and here's a cute trick: if you just wanna read the old limit without modifying it at all, invoke Tcl_SetRecursionLimit with depth equal to 0. peek only, no touch. π
π¨ okay important warning time, no cap:Tcl_SetRecursionLimitonly sets the size of the Tcl call stack. it cannot by itself prevent stack overflows on the C stack being used by your application. so if your machine has a limit on the size of the C stack, you may get stack overflows before reaching the limit set byTcl_SetRecursionLimit. the drama. π if that happens, see if there is a mechanism in your system for increasing the maximum size of the C stack. go fix it, bestie, you got this. πͺ
π KEYWORDS π
nesting depth, recursion π
and that's the whole page, fr fr. this was the Tcl library procedures manual, version 7.0, dated 7.0, filed under Tcl_SetRecursionLimit(3tcl) β mwah, go forth and recurse responsibly πβ¨ππ¦
π¦ where this page comes from
- debian trixie: tcl9.0-doc 9.0.1+dfsg-2
- ubuntu questing: tcl9.0-doc 9.0.2+dfsg-1
- ubuntu resolute: tcl9.0-doc 9.0.3+dfsg-1
- ubuntu stonking: tcl9.0-doc 9.0.4+dfsg-1
- Copyright (c) 1989-1993 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms