Guest User

Untitled

a guest
Jan 20th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ada 0.35 KB | None | 0 0
  1. with Ada.Text_IO;
  2.  
  3. procedure Main is
  4.    type StringFunctor is access procedure(C: Character);
  5.    procedure StringForeach (S: in String; F: in StringFunctor) is
  6.    begin
  7.       for i in S'Range loop
  8.          F(S(i));
  9.       end loop;
  10.    end StringForeach;
  11.  
  12.    S: String := "Hello, world!";
  13. begin
  14.    StringForeach(S, Ada.Text_IO.Put'Access);
  15. end Main;
Add Comment
Please, Sign In to add comment