home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!tulane!cpu.com!cpu.com!GWLESTER
- From: gwlester@cpu.com (Gerald W. Lester)
- Subject: Re: How do I imbed tcl in an application
- Nntp-Posting-Host: merlin.cpu.com
- References: <1992Jul27.175107.7633@rchland.ibm.com> <ADRIANHO.92Jul27175403@barkley.berkeley.edu> <1992Jul28.113922.19882@cas.org>,<156g6sINNnp2@agate.berkeley.edu>
- Sender: usenet@cpu.com (Usenet administrator)
- Organization: Computerized Processes Unlimited, Metairie, LA, (504)-889-2784
- Date: Wed, 29 Jul 1992 22:25:57 GMT
- Message-ID: <1992Jul29.222557.7305@cpu.com>
- Reply-To: gwlester@cpu.com
- Lines: 30
-
- In article <156g6sINNnp2@agate.berkeley.edu>, ouster@sprite.Berkeley.EDU (John Ousterhout) writes:
- >...
- >Second, Larry Virden asked about the extension at the level of sub-commands:
- >
- > Something that I have been wondering about along these lines is based on
- > John's two initial papers. They described the tcl/tk environment in
- > such a way that it seemed that a user would be able to write their own
- > extended sub-options for tcl commands and then the application would
- > read these extentions / parameters , etc and allow the user customizations.
- >
- > Did I get the wrong idea? Is there a way for me to add new commands to
- > a tcl/tk application automatically, or does each application need to add
- > code to handle this possibility? If so, where does that fit into the
- > previously described skeleton that you folks are talking about?
- >
- >You can add commands, but you can't add subcommands to existing commands.
- >For example, if you wanted to add a "remove" option to the string command,
- >so that you could say "string remove <string> <letter>" to remove all
- >instances of <letter> from <string>, you'd have to modify the C code that
- >implements "string".
-
- John,
-
- You could also rename string to something else (eg string_org) than add
- a proc called string that sees if the "command" is an extended command (like
- "remove" in your example above), if so it would process it, otherwise it would
- do an uplevel on "string_orig $args". I know it is "cheating", but it works.
-
- gwl
-
-