* GNAT bug? with ada.calendar
@ 1996-09-23 0:00 Michael A. Packer
0 siblings, 0 replies; only message in thread
From: Michael A. Packer @ 1996-09-23 0:00 UTC (permalink / raw)
I gave a student a program to work on in our intro to computer
programming class using the + function as defined in ada.calendar and
he came back with something that I didn't think should even compile
but strangely enough it does....can someone explain why?
==============================================================================
with ada.text_io;
with ada.integer_text_io;
with ada.calendar;
procedure test_calendar is
x1 : duration := duration(5676);
x2 : duration := duration(3456);
x3 : duration := duration(0);
begin
x3 := ada.calendar."+" (x1,x2);
ada.integer_text_io.put (integer(x1),1);
ada.text_io.new_line;
ada.integer_text_io.put (integer(x2),1);
ada.text_io.new_line;
ada.integer_text_io.put (integer(x3),1);
ada.text_io.new_line;
end test_calendar;
==============================================================================
> gnatmake -v
GNATMAKE 3.05 (960607) Copyright 1995 Free Software Foundation, Inc.
Usage: gnatmake opts name {[-cargs opts] [-bargs opts] [-largs opts]}
the specs for + don't show calling it with left = duration and
right=duration and result also being a duration type....
--
Ph. 540-831-5978 Radford Univ. CS SysAdmin http://www.runet.edu/~pac
Nascar Pick12 Contest: http://www.cs.runet.edu/~pac/pick12.html
All I ask is a chance to prove that money can't make me happy.
Make it idiot proof and someone will make a better idiot.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-09-23 0:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-23 0:00 GNAT bug? with ada.calendar Michael A. Packer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox