[SPAM] - Re: [GAP] advice on Ada in general programming languages course - Email found in subject

Ted Baker baker at cs.fsu.edu
Thu Apr 21 20:37:48 CEST 2005


> I also face the problem of handling Strings that some people mentioned. 
> In the beginning we use a large string and an integer associated with it 
> to store the actual length. Later we use a simple var_string package 
> that contains a bounded string (with a large bound that is usable in 
> most cases) and all the operations required to handle them like if they 
> were regular strings, but in a single package (all the operators, Put, 
> Put_Line, Get_Get_Line, conversion to upper or lower case, etc.). It is 
> just so comfortable to use.

I had not given much thought to variable-length strings, having
done most of my teaching in ANSI C for the past few years.  By
comparison to C, Ada type String comes across pretty well,
including slicing aggregates, length attribute, concatenation, and
the ability to declare local (C "automatic") arrays sized to fit
input values and formal subprogram parameters.

Your var_string package sounds like it might be a good programming
example.  When I taught a first programming course in Ada (many
years ago), we did such a package as one of the exercises later in
the course.

> To make the programming more enjoyable, instead of the regular text_IO 
> we very soon change to Win_IO, a set of packages with window-based input 
> & output that is very simple to use and makes more attractive programs 
> for the students. You can find a pointer to Win_IO in the GAP server.

Is that Win_IO for X-Windows, for MS Windows, or portable to both?

--Ted


More information about the GAP mailing list