comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: A question about syntax or semantics
Date: Sun, 18 May 2014 11:48:30 +0100
Date: 2014-05-18T11:48:30+01:00	[thread overview]
Message-ID: <ly38g75pmp.fsf@pushface.org> (raw)
In-Reply-To: CbVdv.2039585$pa5.172930@fx23.iad

Brad Moore <brad.moore@shaw.ca> writes:

> On 14-05-17 04:56 PM, Victor Porton wrote:
>>  From Ada2012 Reference Manual:
>>
>> arm2012.html/rm-4-1-3.html
>>
>> [[[
>> A selected_component that is not an expanded name shall resolve to denote
>> one of the following:
>>
>>      A view of a subprogram whose first formal parameter is of a tagged type
>> or is an access parameter whose designated type is tagged:
>> ]]]
>>
>> Why it is significant to have it only for the first formal parameter?
>>
>> Please explain with examples.
>>
>>
>
> This question is worded like an exam question, so rather than give the
> answer directly, I'll respond with another question that might shed
> some light on your question.
>
> with Ada.Containers.Doubly_Linked_Lists;
>
> procedure X is
>    package Integer_Lists is new
>        Ada.Containers.Doubly_Linked_Lists (Element_Type => Integer);
>     List1, List2 : Integer_Lists.List;
> begin
>    List1.Append(1);
>    List2.Append(2);
>
>    List1.Move(List2);
> end;
>
> If we didn't have the rule that you are asking about, what could we
> say about the Move call in the example above? Which list is the
> Source, and which list is the Target parameter? Is List1 getting moved
> into List2, or is it the other way around?

Well, considering the various assembler languages around, I'd still be
confused but for different reasons: given "mov r0,r1" does r1 receive
the value in r0 (which is what I'd expect, my first encounter with a
'normal' assembler having been MACRO-32) or does r0 receive the value in
r1?


  reply	other threads:[~2014-05-18 10:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-17 22:56 A question about syntax or semantics Victor Porton
2014-05-17 23:05 ` Bill Findlay
2014-05-18  2:47 ` Brad Moore
2014-05-18 10:48   ` Simon Wright [this message]
2014-05-18 14:40     ` [OT] Assembly language syntax, was: " Simon Clubley
2014-05-18 14:50       ` Simon Wright
2014-05-19 17:02 ` Adam Beneschan
2014-05-19 21:35   ` Randy Brukardt
2014-05-19 22:05     ` Bill Findlay
2014-05-19 22:58     ` Robert A Duff
2014-05-20  8:01       ` Georg Bauhaus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox