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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.128.112 with SMTP id e76mr23719288yhi.38.1398264256452; Wed, 23 Apr 2014 07:44:16 -0700 (PDT) X-Received: by 10.182.130.169 with SMTP id of9mr147285obb.26.1398264256261; Wed, 23 Apr 2014 07:44:16 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!cm18no5639874qab.0!news-out.google.com!gi6ni598igc.0!nntp.google.com!l13no10053507iga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 23 Apr 2014 07:44:15 -0700 (PDT) In-Reply-To: <1ehc8moozpxnj$.1twbrsmoobjry.dlg@40tude.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.145.50.10; posting-account=3_reEwoAAAC163IAIrx427KYmwahFuh9 NNTP-Posting-Host: 83.145.50.10 References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <1ehc8moozpxnj$.1twbrsmoobjry.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <63812656-3d79-4330-8b02-1836f3669b00@googlegroups.com> Subject: Re: Your wish list for Ada 202X From: =?ISO-8859-1?Q?bj=F6rn_lundin?= Injection-Date: Wed, 23 Apr 2014 14:44:16 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 5864 Xref: number.nntp.dca.giganews.com comp.lang.ada:186026 Date: 2014-04-23T07:44:15-07:00 List-Id: Den onsdagen den 23:e april 2014 kl. 16:06:55 UTC+2 skrev Dmitry A. Kazakov= : > On Wed, 23 Apr 2014 05:55:00 -0700 (PDT), bj=F6rn lundin wrote: > > I'd like V'Img to be standard ada like T'Image(V); > > As in the gnat implementation > V means value, not an object? A value could be ambiguous. E.g. Yes value. Sorry if I was not clear. >=20 > OK, considering no place for the sign as in T'Image(V), the image of a > modular and of an integer type will be same. But what about floating poin= t > types: I stated discrete_types. > > type T is some_discrete_type >=20 =20 > > Also, I'd like to be able to define the string function > > for a record type to be used for the 'image attribute. > The only reason why anybody would use an attribute over a [primitive] > function is that the attribute 'Image is predefined by the > language/compiler. If record types ought to get 'Img, you should specify > how to generate it for whatever record type. No. Not the only reason. Another reason is when you work on a legacy system,=20 that was implemented with Ada83. The system then turns out to be stubbornly vital,=20 so it won't go away for many years. But there are few or no tagged types.=20 So, being able to define an 'Img attribute on eg type AD_ASSIGNMENT_RECORD is record ASSIGNMENT_ID : ASSIGNMENT_ID_TYPE; ASSIGNMENT_MODE : ASSIGNMENT_MODE_TYPE; ASSIGNMENT_TYPE : ASSIGNMENT_TYPE_TYPE; CURRENT_ADDRESS : ADDRESS_TYPE; DESTINATION : ADDRESS_TYPE; PRIORITY : INTEGER_4; LAST_ASSIGNMENT : YESNO_TYPE; LOAD_TYPE : PALLET_CODE_TYPE; LOAD_HEIGHT : HEIGHT_CODE_TYPE; LOAD_WEIGHT : INTEGER_4; ZONE : INTEGER_4; HANDLER : ADDRESS_TYPE; SEMI_AUTO_SUB_SYSTEM_ID: SUB_SYSTEM_ID_TYPE; SEQUENCE_ID : STRING(1..SEQUENCE_ID_MAX_LENGTH); PALLET_ID : PALLET_ID_TYPE; ADDITIONAL_INFO_LENGTH : ADDITIONAL_INFORMATION_LENGTH_TYPE; ADDITIONAL_INFO : ADDITIONAL_INFORMATION_TYPE; FILLER_1 : STRING(1..2); -- v8.1 TRANSPORT_TYPE : INTEGER_4; -- v9.1 SHIPPING_DATE : SATTMATE_CALENDAR.TIME_TYPE; -- v9.1 FILLER_2 : STRING(1..2); -- v9.1 end record; for AD_ASSIGNMENT_RECORD'alignment use 4; for AD_ASSIGNMENT_RECORD use -- V6.5b record ASSIGNMENT_ID at 0 range 0..31; -- V6.5b ASSIGNMENT_MODE at 4 range 0..31; -- V6.5b ASSIGNMENT_TYPE at 8 range 0..31; -- V6.5b CURRENT_ADDRESS at 12 range 0..8*24-1; -- V6.5b DESTINATION at 36 range 0..8*24-1; -- V6.5b PRIORITY at 60 range 0..31; -- V6.5b LAST_ASSIGNMENT at 64 range 0..31; -- V6.5b LOAD_TYPE at 68 range 0..31; -- V6.5b LOAD_HEIGHT at 72 range 0..31; -- V6.5b LOAD_WEIGHT at 76 range 0..31; -- V6.5b ZONE at 80 range 0..31; -- V6.5b HANDLER at 84 range 0..8*24-1; -- V6.5b SEMI_AUTO_SUB_SYSTEM_ID at 108 range 0..31; -- V6.5b SEQUENCE_ID at 112 range 0..8*4-1; -- V6.5b PALLET_ID at 116 range 0..8*16-1; -- V6.5b, v8.1 ADDITIONAL_INFO_LENGTH at 132 range 0..31; -- V6.5b, v8.1 ADDITIONAL_INFO at 136 range 0..8*50-1; -- V6.5b, v8.1 FILLER_1 at 186 range 0..8*2-1; -- v8.1 TRANSPORT_TYPE at 188 range 0..31; -- v9.1 SHIPPING_DATE at 192 range 0..16*7-1; -- v9.1 FILLER_2 at 206 range 0..8*2-1; -- v9.1 end record; -- V6.5b for AD_ASSIGNMENT_RECORD'SIZE use 8*208; -- V6.5b, v8.1, v9.1 would be really nice. All types within the record are 2 or 4 bytes integers or strings (The representation clauses where vital for sending record like this with generic functions using ipc on vax/ppc/ and intel boxes. They also where importatant when sending BETWEEN ppc and intelboxes. This is now rewritten, but not tested without the representation clauses= =20 so I do not dear to remove them just yet=20 ) /Bj=F6rn