Extended 'Succ attribute?
- From: "Jérémie Lumbroso" <jeremie.lumbroso@xxxxxxxxx>
- Date: 22 Nov 2006 16:55:09 -0800
Hello,
I just started Ada and was wondering if there is a way to make the Succ
attribute of discrete types behave in a cyclic manner (akin to the
modular type):
type T_DAY is (Mon, Tue, Wed, Thu, Fri, Sat, Sun);
...
day := T_DAY'(Sun);
day := T_DAY'Succ(day); -- that this returns 'Mon' instead of
-- a type constraint error
I could of course define my own function to do this, but I wish to know
if there is a way to get Ada to do it itself.
Regards,
Jérémie
.
- Follow-Ups:
- Re: Extended 'Succ attribute?
- From: Jeffrey R. Carter
- Re: Extended 'Succ attribute?
- From: Adam Beneschan
- Re: Extended 'Succ attribute?
- Prev by Date: Re: generic question
- Next by Date: Re: Extended 'Succ attribute?
- Previous by thread: Ada.Real_Time Vs. Ada.Calendar
- Next by thread: Re: Extended 'Succ attribute?
- Index(es):