Tcl_RecordAndEval(3tcl)
π Tcl_RecordAndEval β bestie edition π
okay so you're in the Tcl Library Procedures corner of the manual and the page we're doing today is Tcl_RecordAndEval. she's giving history-list girlie and honestly? she ate. let's go πΈ
β¨ NAME β¨
Tcl_RecordAndEval β save command on history list before evaluating π
π¦ SYNOPSIS π¦
#include <tcl.h>
int
Tcl_RecordAndEval(interp, cmd, flags)
π ARGUMENTS π
Tcl_Interp *interp(in) β the Tcl interpreter where you wanna evaluate the command. literally the whole vibe lives in here πconst char *cmd(in) β the command (or a whole sequence of commands, she's flexible) that you want to execute β¨int flags(in) β an OR'ed-together combo of flag bits, no cap:TCL_NO_EVALmeans record the command but do not evaluate it πTCL_EVAL_GLOBALmeans evaluate the command at global level instead of the current stack level π
πΈ DESCRIPTION πΈ
So Tcl_RecordAndEval is the function you call when you want to record a command as an event on the history list and then run it using Tcl_Eval (or Tcl_GlobalEval if the TCL_EVAL_GLOBAL bit is set in flags). she does both. multitasking icon π
She returns a completion code like TCL_OK β exactly like Tcl_Eval does β and she leaves info chillin' in the interpreter's result. π«Ά
bestie, listen: if you do not want the command recorded on the history list, then you should invokeTcl_Evalinstead ofTcl_RecordAndEval. that's the whole difference. periodt.
Normally Tcl_RecordAndEval is only called with top-level commands typed by the user, because the entire point of history is to let the user re-issue recently-invoked commands. it's giving up-arrow energy β¬οΈβ¨
And if the flags argument contains the TCL_NO_EVAL bit, then the command gets recorded without being evaluated. recorded but not performed. the ultimate "not me, I'm just watching" move π
Also lowkey important: note that Tcl_RecordAndEval has been largely replaced by the value-based procedure Tcl_RecordAndEvalObj. that value-based procedure records and optionally executes a command held in a Tcl value instead of a string. so like, glow-up version, same soul π
π SEE ALSO π
Tcl_RecordAndEvalObjβ her value-based sister, go say hi π¦
β KEYWORDS β
command, event, execute, history, interpreter, record
mwah π this page is from the Tcl library manual, version 7.4, dated 7.4 β ily, go record some history and slay 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-1997 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms