From: Jim I. <ji...@ap...> - 2002-03-11 23:28:37
|
On 3/11/02 3:02 PM, "Franc Brglez" <br...@cb...> wrote: > Here is our take on the exec -- if you are interested to repeat our > cross-platform experiment, cut the text below and place it under a > mac, a unix, a linux. a ... directory as the following three files: > > @hypothenuse -- to be invoked as 'exec tclsh @hypothenuse' from a tclsh under > any platform ( it also uses 'exec' to invoke hypothenuse below) > > hypothenuse -- a simple proc and its main (to be invoked by @hypothenuse) > > exec4mac.tcl -- Hemang Lavana's adaptation for Franc Brglez from > http://mini.net/tcl/894.html This isn't a real exec, since it can ONLY run tcl scripts. But it is useful if that is all you need to do. > > Our requirement is to write tcltk once and run everywhere, including > code that contains exec command. In this context, we would also be > interested to hear from Jim about any follow-up his earlier work under > http://www.usenix.org/publications/library/proceedings/tcl97/full_papers/ingha > m/ingham_html/ingham.html Well, the part of this paper that is really useful is available on Classic MacOS as the tclAppleScript extension. The other parts described in the paper are (a) connecting to arbitrary OSA extensions, and (b) using Tcl as an OSA language. There is code around from the original version - TcOSAScript, but the only other OSA language of any consequence was Frontier, and I didn't get any requests to support it, so I took out the complexity of supporting other languages in the version shipped with Tcl. The code would be easy enough to revive, if you had a reason. Using Tcl as an OSA language was never terribly interesting, and generally very unstable. OSA languages run in the system heap, and that environment doesn't fit with Tcl's "all malloc's succeed" practices... Vince did more work on this than I did, but I don't think it (or the Perl version) ever got very far. For your purposes, you could also do exec by using TclAppleScript. The problem is that mapping from real exec to AppleScript is not straightforward, and the fact that the Mac only spawns off 1 copy of each executable, and feeds all requests to it can cause unexpected behavior if you are thinking of Unix exec. Most of the tools you use when you do exec are also not present on the Mac. So I am not sure the attempt to make a "cross-platform exec" really gains you that much. Jim -- ++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++=++= Jim Ingham ji...@ap... Developer Tools - gdb |