comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: 'raise' in aspects?
Date: Sun, 26 Oct 2014 00:16:43 -0500
Date: 2014-10-26T00:16:43-05:00	[thread overview]
Message-ID: <m2i03s$l1e$1@loke.gir.dk> (raw)
In-Reply-To: lyy4s67x3m.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyy4s67x3m.fsf@pushface.org...
> "Randy Brukardt" <randy@rrsoftware.com> writes:
>
>> You can write
>>     raise Program_Error with "Not yet implemented";
>> in any function (since a raise expression matches any type), and you 
>> don't
>> have to dream up a useless dummy return value to do so.
>
> actually
>
>   return raise Program_Error with "Not yet implemented";
>
> of course.

Right.

> I liked (but haven't had reason to try; I had already spent far too long
> generating "useless dummy return values") Bob Duff's recursive solution:
>
>   function F return Boolean is
>   begin
>      raise Program_Error with "Not yet implemented";
>      return F;
>   end F;

I think that one is a compiler-fall-over test, at least if the return type 
is a limited and required build-in-place. :-) Not so much for Boolean (but 
of course "return False" works fine there).

                              Randy.


      reply	other threads:[~2014-10-26  5:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18 22:40 'raise' in aspects? Stephen Leake
2014-10-22  5:42 ` Simon Wright
2014-10-22  5:45   ` Simon Wright
2014-10-22 18:08 ` Stephen Leake
2014-10-23 22:42   ` Randy Brukardt
2014-10-24  3:22     ` Shark8
2014-10-24  7:20     ` Simon Wright
2014-10-26  5:16       ` Randy Brukardt [this message]
replies disabled

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