From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!uwm.edu!bionet!agate!dog.ee.lbl.gov!nosc!cod!sampson From: sampson@cod.NOSC.MIL (Charles H. Sampson) Newsgroups: comp.lang.ada Subject: Re: Command line arguments Message-ID: <3034@cod.NOSC.MIL> Date: 1 May 91 23:57:08 GMT References: <1991Apr25.143711.11311@ecst.csuchico.edu> <3275@enea.se> <1991Apr30.135735.1211@iplmail.orl.mmc.com> Organization: Computer Sciences Corporation List-Id: In article <1991Apr30.135735.1211@iplmail.orl.mmc.com> sag@iplmail.orl.mmc.com (Steve Gabrilowitz) writes: > ... if Ada had some construct defined as a part of the language >which would retrieve the commmand line parameters nothing would prevent >the compiler writers from implementing whatever it was on VMS by internally >calling the appropriate CLI$ functions - and isn't that part of what Ada >is all about, providing a programming environment which is uniform and >consistent over different platforms? > >The only problem I see with putting access to the command line into the >Ada language is how it would be handled on embedded real time systems where >the OS doesn't provide any mechanism for getting at the command line - >indeed, there isn't even a command line to get at ;-) > >Perhaps this could best be handled by providing a recommended "standard" >for getting the command line in Chapter 13? This issue was discussed a few months ago and I'll repeat the same point I tried to make then. Suppose there were a standard Ada technique for accessing command line parameters. What would it gain you? You could get at the parameters, but they would be different on different operating systems, so the code to process those parameters would not be transportable. In saying this I assume that you want the parameters in the VMS version of your program to be VMS-like, and in the UNIX version to be UNIX-like. If this assumption is wrong we can argue about it, but the issue is then user interface, not Ada. I've now directed the implementation of several small multi-platform programs written in Ada and the approach that I've used is one suggested by another responder: The information obtained from the command line parameters is abstracted in a package specification; that package's body is rewritten for each environment. One of these programs was ported to an environment that does not have command line parameters and the package body in this case implemented a set of hierarchical menus to obtain the required information. Charlie