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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c70bb16b3813e0fd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-20 18:11:44 PST Path: nntp.gmd.de!xlink.net!news.dfn.de!swiss.ans.net!howland.reston.ans.net!math.ohio-state.edu!magnus.acs.ohio-state.edu!csn!perez From: perez@oldcolo.com (Carlos Perez) Newsgroups: comp.lang.ada Subject: Re: Ada Portability... NOT! Date: 21 Nov 1994 02:11:44 GMT Organization: Old Colorado City Communications (oldcolo.com - login "newuser") Message-ID: <3aovl0$79m@news-2.csn.net> References: <199411182104.PAA04854@mail.cs.utexas.edu> <3alalm$9di@gnat.cs.nyu.edu> NNTP-Posting-Host: oldcolo.com X-Newsreader: TIN [version 1.2 PL2] Date: 1994-11-21T02:11:44+00:00 List-Id: Robert Dewar (dewar@cs.nyu.edu) wrote: : A more portable approach in your particular case is to read the data into : a byte stream (in Ada 9X, use a Storage_Array), and then use unchecked : conversion to convert the data to usable floating-point form. : Isn't that interesting? The above advice says that you can make the code : *more* portable by using unchecked_conversion. Often people have a knee-jerk : reaction to avoid UC in portable code, but that's quite misinformed. Just as : a careful C programmer will use (carefully chosen) cross-type casts to : achieve portability, a careful Ada programmer can use (carefully chosen) : unchecked conversions. Count me in as one of those knee-jerk liberal Ada programmers ;-). I guess I've seen so many bad UC cases that its hard to imagine that it can be used to create portable code. For example, how do you "portably" take care of the "endianess" of a machine that has plagued programmers since the Dawn of Computing? I certainly wouldn't write a generic byte-swapping package unless I was force too. And what about octal-hex converstions? There may be a few old octal machines floating around (PDP's?) in garage sales somewhere (or in old military aircraft, I suppose). : Actually in Ada 9X, this sort of problem is much better handled using : streams in any case. Cool... I'm new to 9X and will check this feature out. Thanks for help! I knew there was a reason I was a closet "team Ada" advocate! -- Carlos