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=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7d533acec91ae16,start X-Google-Attributes: gid103376,public From: "Corey Ashford" Subject: Question for the folks who designed Ada95 Date: 1999/04/26 Message-ID: <7g2qu4$ca4$1@usenet.rational.com>#1/1 X-Deja-AN: 471235630 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Rational Software X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 1999-04-26T00:00:00+00:00 List-Id: About modular types. In general, I think they are pretty good, but there is one thing that has been brought up several times on this newsgroup and I consider that the solutions offered were less than adequate. Shifts! Why didn't Ada95 make a shift operator a first-class operator on modular types. There wouldn't be any need to introduce new syntax. Something like this would be good: type reg32 is mod 2**32; ... x : reg32; y : reg32; z : natural; ... x := reg32'shift_left(y, z); The problem with the interfaces package shift operators is that they have fixed types. So it's difficult to write code for types whose size can vary. Any thoughts as to why the shift operator wasn't given a better treatment? Or am I all wet, and there's really a good way to do shifts? (Please don't suggest using divides or multiplies as the efficiency of the code generated can vary widely across different compilers and optimization levels). Thanks - Corey