Hello, I'm going to write a series of Jupyter notebooks about Ada 2020 support in GNAT Community Edition 2020. First two are there: * Ada 2020: 'Image attribute for any type * Ada 2020: Redefining the 'Image attribute https://github.com/reznikmm/ada-howto/tree/ce-2020 Best regards,
> I'm going to write a series of Jupyter notebooks about Ada 2020 support in GNAT Community Edition 2020.
Nice idea, this is a nice way to teach Ada indeed
"Maxim Reznik" <reznikmm@gmail.com> wrote in message news:5707111a-7eb1-42f5-946b-6df8f617b65cn@googlegroups.com... > Hello, > > I'm going to write a series of Jupyter notebooks about Ada 2020 support in > GNAT Community Edition 2020. > > First two are there: > * Ada 2020: 'Image attribute for any type This is an Ada 2012 (Corrigendum 1) feature; it *predates* Ada 202x. All Ada 2012 compilers should support it (eventually); the ACATS for Ada 2012 expects it to be implemented and has a set of tests for it. > * Ada 2020: Redefining the 'Image attribute This is an Ada 202x feature. But the details of this particular feature are still open (in particular the Text_Buffers packages), so the GNAT implementation may still change. Beware. Randy.
пятница, 4 сентября 2020 г. в 00:42:59 UTC+3, Randy Brukardt: > > * Ada 2020: 'Image attribute for any type > This is an Ada 2012 (Corrigendum 1) feature; it *predates* Ada 202x. All Ada Could you send an ARM link to prove this? Because what I see is 88 S'Image For every **scalar** subtype S: http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-K-2.html TIA
You have to look to the bottom of the page (it is X'Image that is relevant here): http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-3-5.html#p55.1 The definition is paragraphs 55.1-.4/4. Or you could look in Annex K.2(91.1-2/4). Randy. "Maxim Reznik" <reznikmm@gmail.com> wrote in message news:361943a7-1c8a-436f-b535-54a9da8b5d06n@googlegroups.com... ???????, 4 ???????? 2020 ?. ? 00:42:59 UTC+3, Randy Brukardt: > > * Ada 2020: 'Image attribute for any type > This is an Ada 2012 (Corrigendum 1) feature; it *predates* Ada 202x. All > Ada Could you send an ARM link to prove this? Because what I see is 88 S'Image For every **scalar** subtype S: http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-K-2.html TIA
But this works only for SCALAR types (in Ada 2012 TC1), right? While in Ada 202x this works for ANY type, such as records, arrays and access types. That is what I try to describe in the notebook. -- Max
On 9/5/20 12:06 AM, Randy Brukardt wrote:
> You have to look to the bottom of the page (it is X'Image that is relevant
> here):
>
> http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-3-5.html#p55.1
>
> The definition is paragraphs 55.1-.4/4. Or you could look in Annex
> K.2(91.1-2/4).
That still seems to be limited to scalar subtypes:
55.1/4
For a prefix X that denotes an object of a scalar type (after any implicit
dereference), the following attributes are defined:
nor does Annex K differ.
--
Jeff Carter
"Don't knock masturbation. It's sex with someone I love."
Annie Hall
45
"Maxim Reznik" <reznikmm@gmail.com> wrote in message
news:2ea8f3d3-4d2b-47e4-bd6b-0038a210b18bn@googlegroups.com...
> But this works only for SCALAR types (in Ada 2012 TC1), right?
> While in Ada 202x this works for ANY type, such as records, arrays and
> access types. That is what I try to describe in the notebook.
Ah, you're conflating the notation X'Image (for objects), which is Ada 2012
TC1, and Image for all types, which is indeed Ada 202x. When I read the
title of the notebook, I saw the former, not the latter. Note that S'Image
works for all types as well in Ada 202x, it's not about the form of the
attribute.
(I realize that one can just use the object form, since you can always
qualify any expression that is not allowed as a prefix, and that would be
only 1 character longer than the subtype form [one extra '; the parens just
move to the prefix from the attribute argument]. But that really is a style
guide issue, and not everyone will agree.)
Randy.
On Wednesday, September 2, 2020 at 6:58:09 PM UTC+5:30, Maxim Reznik wrote:
> Hello,
>
> I'm going to write a series of Jupyter notebooks about Ada 2020 support in GNAT Community Edition 2020.
>
> First two are there:
> * Ada 2020: 'Image attribute for any type
> * Ada 2020: Redefining the 'Image attribute
>
> https://github.com/reznikmm/ada-howto/tree/ce-2020
>
>
> Best regards,