[Peter Newman] 10 January 2005: -------------------- [Unified Programming Language] '''Traditional Tcl''' Traditional Tcl is '''command-oriented'''. In that each 'line' of code consists of a command name - which is supposed to be the first thing on the line - followed by the command's arguments. This seems to be an essential feature of Tcl; so if we're going top make a '''Tcl/2''', it seems that we should keep it. '''Object-Oriented Tcl''' But there also seems to be a huge demand for an '''object-oriented''' Tcl. As best I can tell, probably as much of 50% of Tcl'ers would like an object-oriented form of the language. And that seems true of programmers and programming languages in general. Python and Lua are 100% object-oriented (from the little I know about them). And Perl and C++ are about 50% object-oriented. So if we're going to re-design Tcl, then implementing an object-oriented form of the language seem to be desirable. '''Doing Both''' Fortunately, with '''UPL''', we can do both. UPL is a framework that allows each individual programmer to select/create the programming language of their choice. So we can (and IMHO should,) develop both a command-oriented and an object-oriented form of '''Tcl/2'''. '''The Object-Oriented Flavour''' Another issue that arises is "Which form of object-oriented syntax should we use" (there seem to be many competing flavours out there; [Incr Tcl], [Snit], etc). Fortunately, with UPL it doesn't matter. Anybody that wants to implement this or that particular syntax can simply do so. '''Object-Oriented Traditional Tcl''' Traditional Tcl, or more precisely Tk, is already somewhat object-oriented. Consider:- frame .myFrame .myFrame cget -borderwidth. Although ''.myFrame'' is a command, you can also think of it as an object, with ''method'' cget and ''property'' -borderwidth. This idea can easily be extended to standard traditional Tcl commands. Check out [SS]'s [cfile] - where he's basically implemented the standard I/O commands in objected-oriented form. The file handle becomes an ''object ID''. And things like; ''read'', ''close'', ''seek'', ''tell'' and ''puts'', etc, become the methods that it supports. So one quick and easy way of making Tcl more object-oriented, would to convert all of Tcl in a similar manner. Implementing an object-oriented Tcl this way is (IMHO,) the best way to go. It's quick and easy - and reasonably familiar to traditional Tcl/Tk programmers. It's also compatible with traditional command-oriented Tcl; the two can live side by side in the same parser. In addition, these new Tcls aren't an end in themselves. They're really just two languages we're using to develop and test '''UPL''' with. So we don't want to get bogged down with the syntax of them. Refining and creating the syntax of the new '''Tcl/2''', is really something to be done once '''UPL''' has created the framework that makes this possible. '''TCL/c & TCL/o''' Maybe we could call these two new prototype Tcl/2's; '''Tcl/c''' (for the command-oriented one) and '''Tcl/o''' (for the object-oriented one).