Created
November 14, 2012 03:32
-
-
Save anonymous/4070079 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.data); str := str.next; end loop; new_line; end show; | |
begin | |
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