comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Hermann <ica2ph@csv.ica.uni-stuttgart.de>
Subject: Re: Extended 'Succ attribute?
Date: Fri, 24 Nov 2006 13:02:50 +0000 (UTC)
Date: 2006-11-24T13:02:50+00:00	[thread overview]
Message-ID: <ek6qhq$og9$1@infosun2.rus.uni-stuttgart.de> (raw)
In-Reply-To: 1164247477.100738.32670@b28g2000cwb.googlegroups.com

Adam Beneschan <adam@irvine.com> wrote:
> J?r?mie Lumbroso wrote:
[snip all]

I agree 100% to Adam Benescha.
Moreover, my experience says, that array accesses are fastest.
However, that still depends on tests.
I played around with the following:


-- package Ada.Calendar.Formatting is
-- -- Day of the week:
-- type Day_Name is (Monday, Tuesday, Wednesday, Thursday,
-- Friday, Saturday, Sunday);
-- function Day_of_Week (Date : Time) return Day_Name;

with Ada.Calendar.Formatting;
 use Ada.Calendar.Formatting;
with ada.text_io;
procedure ada2005calendartest3ph is
  type next_day_type is array(day_name) of day_name;
  next_day : next_day_type :=
  (Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Monday);
  specimen : day_name := Friday;
begin
  ada.text_io.put_line("starting program ada2005calendartest3ph");
  for i in 1..9 loop
    ada.text_io.put_line(day_name'image(specimen));
    specimen:=next_day(specimen);
  end loop;
--result:
--starting program ada2005calendartest3ph
--FRIDAY
--SATURDAY
--SUNDAY
--MONDAY
--TUESDAY
--WEDNESDAY
--THURSDAY
--FRIDAY
--SATURDAY
end ada2005calendartest3ph; --20061124ph
-- 
--Peter.Hermann@ihr.uni-stuttgart.de        (+49)0711-685-872-44(Fax79)
--Nobelstr.19 Raum 0.030, D-70569 Stuttgart IHR Hoechstleistungsrechnen
--http://www.ihr.uni-stuttgart.de/



  reply	other threads:[~2006-11-24 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-23  0:55 Extended 'Succ attribute? Jérémie Lumbroso
2006-11-23  2:04 ` Adam Beneschan
2006-11-24 13:02   ` Peter Hermann [this message]
2006-11-23  6:38 ` Jeffrey R. Carter
replies disabled

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