CompuServe Thread

#NonTCL Ported to TCL

3 messages in this thread
#7271From: Gary MorrisonJul 21, 1993 1:09 AM
I am developing an application using some nontrivial DSP algorithms. To develop those algorithms, I've created a special application as a more ideal test environment, which is not the real user interface itself. I'd like to use TCL for the user interface of the real application, but obviously I'd like to avoid changing the code that does move over to the real application any more than necessary. Do any of you have any words of wisdom, or know of any useful books, MacTutor/Tech articles, or CompuServe threads, or whatever, that discuss any "gotchas" that could come about from dropping large chunks of nonTCL code into a TCL environment? As for my level of TCL understanding and background, I've read the TCL documentation, but I've never actually written any code for it. Thanks folks!
#7296From: Rich ParkerJul 21, 1993 1:19 PM
Gary, THINK C is an ANSI-compliant compiler, so you should have no problem dropping non-TCL code (as long as it isn't object code…or objects that might conflict with the TCL) into an application that uses a TCL skeleton. In fact, it's quite easy to do so, especially if you've built your skeleton with AppMaker. In any one of the (appropriate) modules' DoCommand method, you could put a call to your DSP code and it should work without any problem. In general, Mac applications use "events" to trigger an action, so a button click or menu choice would be most appropriate to trigger the execution of your DSP code. Those events are handled in the DoCommand methods (usually) in the view, document, or application. I see no problem in doing what you want. -rich-
#7334From: Gary MorrisonJul 21, 1993 6:59 PM
Great. Some possibilities that pop into mind where confusion might occur: 1. Does popping up a dialog box (more importantly a progress dialog) via direct toolbox calls confuse TCL? Do some object in TCL expect to know about every window in order to operate properly? 2. My error recovery mechanism, although somewhat similar with TCL's, is not identical. Are there any nonobvious confusion factors that could arise from that? 3. I have direct calls to Memory Manager functions (NewHandle(), HLock(), etc.). TCL code, as I recall, expects you to call their memory allocation routines so that it can take care of the rainy-day fund, critical operation, and such. Am I going to have to replace all of those calls with TCL equivalents? If I were to sit down and think about it some more, I could probably think up more such issues. Any more general thoughts? Thanks.