Does Ada have support for something similar to an Obj-C variable in a string?
NSLog(@"This is text, here's a variable %f", floatvar);
I’d like to be writing nice one-liners, like:
put_line("The answer is %v", answer);
instead of
put_line("The answer is ");
put(answer);
Assuming you have
F : Float;, you can sayThis doesn’t work so well if you want neat formatting, because the format output by
’Imageis fixed as specified in the ARM (that link’s actually to’Wide_Wide_Image, not’Image, but the format’s the same).If you’re using GNAT, you could write the above as
which saves (a) characters and (b) remembering the type concerned, but that’s not portable.