Sujet : Re: [info stacktrace] → ask for assistance
De : aotto1968 (at) *nospam* t-online.de (aotto1968)
Groupes : comp.lang.tclDate : 27. Nov 2024, 15:03:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vi78se$1cks$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 27.11.24 10:29, Ralf Fassel wrote:
* aotto1968 <aotto1968@t-online.de>
| TCL could have a wonderful "exception" interface
>
| 1. The (Tcl_GetReturnOptions) dict is the "exception-object"
| > example:
| > Tcl_GetReturnOptions(interp,TCL_ERROR): -code 1 -level 0
| > -errorstack {INNER {invokeStk1
| > ::tcllcconfig::LcSettingC::MK_NULL LookupBool in} CALL
| > {::oo::Obj40::my LcSettingLookupBool}} -errorcode NONE
| > -errorinfo
| {'LcSettingC' hdl is NULL
| > while executing
| > "$setting LookupBool $name"
| > (class "::LibLcConfigRpcServer" method "LcSettingLookupBool" line 4)
| > invoked from within
| > "::oo::Obj40::my LcSettingLookupBool"} -errorline 1
| 2. The "-errorstack" key has the LIST of [info frame] dicts until catch
>
| -> everyone is happy
I guess your contribution to the TCL code base would probably be
welcome, provided there is agreement on the necessity of this
feature...
=> https://core.tcl-lang.org/tips/doc/trunk/doc/help.md
R'
The problem is always "time" … I work with a dozens of languages and TCL is just one of them…
for example today I figured out how to implement this in python…
def MkErrorC_FormatException(err,exp,caller):
err.NoRaise().SetC(str(exp),caller)
tb = exp.__traceback__
while tb is not None:
err.StackFormat(
tb.tb_frame.f_code.co_qualname,
tb.tb_frame.f_code.co_filename,
tb.tb_lineno
)
tb = tb.tb_next
and by-the-way I add a feature to direct "inject" python-code into a python-c-extension without
shipping an extra python source file.
→ My problem is always NOT to drift-away into old-style-language-development…