comp.lang.ada
 help / color / mirror / Atom feed
* Limited Type Access - Again
@ 2001-10-29 18:51 ANH_VO
  2001-10-29 21:25 ` Matthew Heaney
  2001-10-30 16:44 ` Mark Lundquist
  0 siblings, 2 replies; 3+ messages in thread
From: ANH_VO @ 2001-10-29 18:51 UTC (permalink / raw)
  To: comp.lang.ada

Thanks all for your response, specially Mark and Matt.

Here comes the next question

type Object is 
    record
        Sem : Binary_Access;
   end record;

Obj_1 : Object;
Obj_2 : Object;

if Obj_1 /= Obj_2  then
   Obj_1 := Obj;
end if;

This is equivalent to

if Obj_1.Sem /= Obj_1.Sem then
   Obj_1.Sem := Obj_2.Sem;
end if;

It looks to me that equality and assignment do not make sense at all. 

Anh Vo



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Limited Type Access - Again
  2001-10-29 18:51 Limited Type Access - Again ANH_VO
@ 2001-10-29 21:25 ` Matthew Heaney
  2001-10-30 16:44 ` Mark Lundquist
  1 sibling, 0 replies; 3+ messages in thread
From: Matthew Heaney @ 2001-10-29 21:25 UTC (permalink / raw)



<ANH_VO@udlp.com> wrote in message
news:mailman.1004389122.4372.comp.lang.ada@ada.eu.org...
> It looks to me that equality and assignment do not make sense at all.

I don't understand your objection.  The default equality operator for record
types is defined as the conjunction of equality of all the record
components.  What behavior were you expecting?






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Limited Type Access - Again
  2001-10-29 18:51 Limited Type Access - Again ANH_VO
  2001-10-29 21:25 ` Matthew Heaney
@ 2001-10-30 16:44 ` Mark Lundquist
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Lundquist @ 2001-10-30 16:44 UTC (permalink / raw)


Hi Anh,

<ANH_VO@udlp.com> wrote in message
news:mailman.1004389122.4372.comp.lang.ada@ada.eu.org...
> Thanks all for your response, specially Mark and Matt.
>
> Here comes the next question
>
> type Object is
>     record
>         Sem : Binary_Access;
>    end record;
>
> Obj_1 : Object;
> Obj_2 : Object;
>
> if Obj_1 /= Obj_2  then
>    Obj_1 := Obj;
> end if;
>
> This is equivalent to
>
> if Obj_1.Sem /= Obj_1.Sem then
>    Obj_1.Sem := Obj_2.Sem;
> end if;
>
> It looks to me that equality and assignment do not make sense at all.

Well, they've always made sense before... :-)

It sounds like you're thinking that while the two examples above are
equivalent, the first one is legal while the second is not.  But the second
example is perfectly legal -- Binary_Access (from the example in your
earlier post) is just an access type, which is non-limited, so there's
nothing wrong with the second example.

???

-- mark






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-30 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-29 18:51 Limited Type Access - Again ANH_VO
2001-10-29 21:25 ` Matthew Heaney
2001-10-30 16:44 ` Mark Lundquist

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