Talk:Tcl
From Wikipedia, the free encyclopedia
Suggest fixing the technically incorrect language "rather unique." Something is either unique or it's not.
Yeah. I fixed it, and a few other non-native-englishisms. I think the page could do with a lot more polish, however. (yes, that *is* a pun)
Contents |
[edit] NPOV?
I don't think there's a single sentence in this article that even remotely tries to address any criticism of the tcl language. ALl things have pros and cons yet this article makes no effort to address those in the context of tcl... I think we should put up one of those NPOV wikipedia headers until someone addresses this article from the other side.
--129.85.41.250 18:32, 27 July 2006 (UTC)
- This article is about the TCL language, and as long as it correctly describes the language's syntax/features then it's neutral. If any valid criticisms exist then they can be added. They must also include references to promminent sources, otherwise it would be an "original research" violation. The exclusion of criticisms does not make it POV since this is not a "TCL Criticisms" article. I've removed the NPOV tag. Spookfish 10:54, 28 July 2006 (UTC)
[edit] Digital clock
The Digital clock example gives the error:
invalid command name "label"
--Peak Freak 17:56, 13 Apr 2005 (UTC)
You forgot "package require Tk" or using /usr/bin/wish as the interpreter.
--Ethouris
[edit] Various
1. I think it is improper to write examples, which require Tk package. These should be added to the description of Tk.
2. Symbols: you forgot the :: symbol to manage namespaces and global variables.
--Ethouris 19:26, 14 Apr 2005 (UTC)
[edit] Some evidence needed for a statement
The feature list has following statement: "Easy to maintain code. Tcl scripts are often more compact and readable than functionally equivalent code in other languages." Where is the evidence for this statement? Without good evidence I would suggest to remove that statement. --shd
[edit] Command evaluation: I don't get it
from the article: The subcommand is evaluated first and the result is substituted as the argument. Alternatively, any argument placed in curly braces will not be evaluated, but rather will be handed directly back to the orginal command as an argument.
I don't understand: "handed directly back to the orginal command as an argument" should the sentence be rewritten? ori 10:52, 16 August 2005 (UTC)
- If I have
commandWord [anotherCommandWord arg1 arg2]
the command within the square brackets gets evaluated and its result is given to commandWord as argument.
If I have
commandWord {aWord aSecondWord aThirdWord}
the content within the curly brackets will be handed as a list as one argument to commandWord. I hope this helps.Hirzel 11:02, 16 August 2005 (UTC)
- very helpful actually. shouldn't we add (change) it to the article? ori 12:17, 16 August 2005 (UTC)
[edit] Scope not dynamic
One of the listed features is dynamic scope. Tcl's variable are in fact lexically scoped; consider these two procs:
proc foo {} { set a 1 bar } proc bar {} { set a } % foo can't read "a": no such variable
In a dynamically scoped language (such as Perl 4 or Emacs Lisp), the variable a
would be visible and defined during evaluation of bar
. In a lexically scoped language (such as C or Python) it wouldn't. Tcl's variables are lexically scoped by default, with the programmer given the ability to communicate with the enclosing scope using uplevel
and upvar
.
If no one objects, I'll remove the dynamic scope bullet and add something about upvar/uplevel. Hniksic 15:17, 29 August 2005 (UTC)
In my understanding, lexical scoping means "getting the values at definition time", while dynamic scoping means "getting the values at runtime". You are right that variables inside functions are by default local, but with upvar you can retrieve variables higher up in the call stack *at runtime* - that's why I'd still defend (potential) "dynamic scope". http://wiki.tcl.tk/2775 demonstrates in 13 lines of code how it can be implemented. Suchenwi 17:35, 7 March 2006 (UTC)
- Obviously, the values need to be obtained at run-time in both cases, otherwise the variable would effectively remain constant. The question is where to look for the value. Lexical scope refers to the variable being accessible only inside the lexical block where it is defined, which means that functions don't see it. This is indeed the case in Tcl, as shown with the above example. upvar is misleading because it is a mechanism for *explicit* reference-passing to other functions, akin to C's pointers. That is why existence of upvar doesn't make Tcl dynamically scoped, just like the existence of pointers doesn't make C dynamically scoped. 194.152.226.5 12:56, 15 September 2006 (UTC)
[edit] Uplevel and upvar
The page doesn't mention uplevel and upvar, which are distinct features of Tcl not found in other languages. If no one objects, I'd like to add a section about them. (They might even be covered by a separate page because they're quite interesting from a language design and studying perspective and can be accompanied by illuminating examples.) Hniksic 15:26, 29 August 2005 (UTC)
As I understand it, upvar provides functionality somewhat like call-by-name, and as such it is a very sophisticated mechanism. Compare and contrast with call-by-value (how Tcl commands work by default) and call-by-reference (not used in Tcl at all), which are the dominant argument passing mechanisms in most programming languages. I've started a page on uplevel but more input from others would be welcome. - Donal Fellows. 10:50, 05 September 2005
[edit] Infobox
Maybe this article should have an infobox like the Perl one.
Update: there is an infobox now, but no logo. Plenty of logos here: http://www.demailly.com/tcl/about/logos.html
Logo taken care of (about time!)... Timbaland 03:43, 27 December 2006 (UTC)
[edit] Eggdrop
Can someone throw something into the article about Eggdrop.. what I believe to be the main use of this language. — Deon555talkReview 02:29, 19 October 2006 (UTC)
Actually, the major uses seem to be in GUIs, Electronic Design Automation, and system testing. 82.42.250.222 00:35, 9 January 2007 (UTC)