Category:Tcl: Difference between revisions

→‎Language Syntax: Added some description of selected more recent commands of interest
(Is (usually used as) a procedural programming language)
(→‎Language Syntax: Added some description of selected more recent commands of interest)
Line 98:
'''uplevel''' ?''level''? ''arg''...
:Concatenate the arguments and evaluate them as a script in the stack frame given by ''level'' (or the stack frame that called the current procedure if that is omitted). Due to syntactic ambiguities, it is recommended that the ''level'' always be specified explicitly.
==== From Tcl 8.5 ====
'''apply''' ''lambdaTerm arg…''
:Applies a lambda term to zero or more arguments. Lambda terms are two- or three-element tuples, the first element being the formal parameter description, the second being the script that implements the lambda (just as with '''proc''') and the optional third being the context namespace (with the default being the global namespace).
'''dict''' ''subcommand'' …
:Manipulates dictionaries, values that describe a (sparse) mapping from arbitrary keys to arbitrary values (well, so long as both are themselves values).
==== From Tcl 8.6 ====
'''coroutine''' ''name command arg…''
:Create a coroutine called ''name'', which is implemented by the execution of ''command'' together with any supplied arguments. The ''name'' is the name of a command that will be used to resume the coroutine.
'''yield''' ?''value''?
:Yield from a coroutine, with optional value (empty if not supplied). Result will be the optional resumption argument to the coroutine's command.
'''tailcall''' ''command arg…''
:Stops the execution of the current context and replaces it with a call to the given ''command'' with any arguments.
'''oo::class create''' ''name body''
:Creates a class called ''name'' with definition ''body''. Instances of ''name'' are created with “''name'' '''new''' ''arg…''” and “''name'' '''create''' ''instanceName arg…''”. (Note that the syntax for '''oo::class''' is a consequence of this.)
 
==Language Semantics==
Anonymous user