comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Storage_Error: mine's or gnat's fault?
Date: Fri, 3 Jun 2016 15:48:03 -0700
Date: 2016-06-03T15:48:03-07:00	[thread overview]
Message-ID: <nit1f4$ov9$2@dont-email.me> (raw)
In-Reply-To: <nit1b3$ov9$1@dont-email.me>

On 06/03/2016 03:45 PM, Jeffrey R. Carter wrote:
> On 06/03/2016 02:43 PM, Alejandro R. Mosteo wrote:
>>
>>    function First_Element (Container : List) return Element_Type is
>>    begin
>>       if Checks and then Container.First = null then
>>          raise Constraint_Error with "list is empty";
>>       end if;
>>
>>       return Container.First.Element.all; -- <-- RAISES
>>    end First_Element;
> 
> What is Checks? If it is/returns False when the list is empty, you'll try to
> dereference null.

My mistake. That's the code for the container, not your code.

-- 
Jeff Carter
"I wave my private parts at your aunties."
Monty Python & the Holy Grail
13


  reply	other threads:[~2016-06-03 22:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-03 21:01 Storage_Error: mine's or gnat's fault? Alejandro R. Mosteo
2016-06-03 21:43 ` Alejandro R. Mosteo
2016-06-03 22:45   ` Jeffrey R. Carter
2016-06-03 22:48     ` Jeffrey R. Carter [this message]
2016-06-04 18:50   ` Simon Wright
2016-06-05 14:05     ` Alejandro R. Mosteo
replies disabled

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