Category:Tcl: Difference between revisions
Content added Content deleted
(Work towards making this page more informative) |
(→Language Syntax: More detail on effective syntax) |
||
Line 46: | Line 46: | ||
'''|''' “''\\''” escapeSequence charSubsts''?'' |
'''|''' “''\\''” escapeSequence charSubsts''?'' |
||
'''|''' ordinaryChar charSubsts''?'' |
'''|''' ordinaryChar charSubsts''?'' |
||
The syntax of the language is defined more exactly in the [http://www.tcl.tk/man/tcl8.5/TclCmd/Tcl.htm Tcl(n)] manual page. |
|||
===Conceptual Command Syntax=== |
|||
Though formally not part of the language syntax, the syntactic style of the language's standard commands mostly follow a few basic syntactic principles: |
|||
* Commands are variadic, and frequently accept arbitrary numbers of arguments. |
|||
* Commands that take options will prefix the option name with a single ASCII hyphen, “-”, and if a value parameter to the option is required, that parameter will be in a subsequent argument to the option name. |
|||
* Option names are not single character long strings after removing the hyphen (except in rare cases) and <code>getopt</code>-style argument combination is never supported. |
|||
* Commands perform callbacks by evaluating a caller-provided Tcl script. |
|||
** During-execution callback scripts are evaluated in the context of their caller. |
|||
** After-execution callback scripts are evaluated in the global scope. |
|||
* Commands cannot discover how their arguments were quoted. |
|||
==Language Semantics== |
==Language Semantics== |
||
===Value Model=== |
===Value Model=== |