Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:4070079
Created Nov 14, 2012

What would you like to do?
with Ada.text_io; use Ada.Text_io;
procedure test is
-- type declarations needed to define type Lstring -- don't worry about limited private at this stage
function toLstring (Str : in String) -- full declaration of the function body
function toString (Lstr : Lstring) -- full declaration of the function body
lstr1 : Lstring;
-- a small procedure to display the contents of an Lstring -- it assumes the type declarations shown above procedure show (lstr : Lstring) is str : str_link; begin if lstr = null then return; end if;
str := lstr.list; while str /= null loop Put(; str :=; end loop; new_line; end show;
lstr1 := toLstring("This is a test string"); show(lstr1); put_line("'" & toString(lstr1) & "'");
end test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment