From: tclwarrior@gmail.com
Subject: How do i print stuff?
Date: Sat, 28 Oct 2017 11:07:03 -0700 (PDT)
Date: 2017-10-28T11:07:03-07:00 [thread overview]
Message-ID: <f9da3284-c9ee-47c5-b176-f74fbd921b5e@googlegroups.com> (raw)
Hi,
This is my first day learning Ada
I know other languages (Mainly Perl and SQL)
So I am not total newbie
Anyway,
After that I saw this tweet https://twitter.com/shishini/status/924328446490218496
I decided that my first program, would be exactly that
I came up with this
-- Code
with Ada.Text_IO;
procedure Main is
a : Float := (0.3 - 0.2);
b : Float := (0.2 - 0.1);
c : Boolean := (a=b);
begin
if c then
Ada.Text_IO.Put_Line("true");
else
Ada.Text_IO.Put_Line("false");
End if;
end Main;
-- Code
Which at least show me that Ada is more like Go and D
But, I failed miserable to simply Print a, b and c
well, I kind of succeeded in printing a and b using
Float_Text_IO.Put
But could not find a way to Print c (a boolean)
Well, so my question, that is the strategy to print stuff in Ada
does have have a print statement that can print any type
does each type have his one print statement
Should I cast all types to strings and print them using Text_IO
How do I cast floats and booleans to strings?
Thanks
Ali
next reply other threads:[~2017-10-28 18:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-28 18:07 tclwarrior [this message]
2017-10-28 18:30 ` How do i print stuff? Niklas Holsti
2017-10-28 18:52 ` Niklas Holsti
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox