4 ms·
It's Ada Lovelace Day Learn the Ada Programming Language in 2021
- Bostonian 5y agoNot being able to directly print an integer without calling a function to convert it to a string is awkward. The article presents this bit of code: with ada.Text_IO; use Ada.Text_IO; procedure Main is myNumber: Integer; begin myNumber := 123; Put_Line ( Integer'Image (myNumber) ); end Main;
- synack 5y agoThere are several ways to do this. Put_Line (myNumber'Image); works just as well as Integer'Image. with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; Put (myNumber); Integer_Text_IO is included in the standard library. More info here: http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-10-8.html http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-10-8.... There's also a proposal to add format strings to the language: https://github.com/AdaCore/ada-spark-rfcs/pull/77 https://github.com/AdaCore/ada-spark-rfcs/pull/77
- deleted 5y ago[deleted]