[GAP] advice on Ada in general programming languages course

Alejandro R. Mosteo alejandro at mosteo.com
Thu Apr 21 17:47:07 CEST 2005


Robert Dewar wrote:
> Alejandro R. Mosteo wrote:
> 
>> Let's see, I don't see nothing fundamentally wrong in Unbounded, but 
>> when you start adding the "no use" rule, throw in some I/O needs 
>> (another package(s) to with/instantiate), all that after being as 
>> teacher in the uneasy situation of saying "yes, String is a string but 
>> to do that is easier to use this package...", you're already in a 
>> somewhat defensive position.
> 
> 
> WHy on *earth* would you "throw in" the no use rule. This is a silly
> rule in the context of student teaching, and it is by no means agreed
> on in other contexts (i find it frankly terribly misguided these days,
> when tools can perfectly well at a click tell you where anything came
> from). Unbounded is definitely designed to be used with a use clause.
> To do anything else is unnecessary and unjustified torture of students,
> and yes, by gosh, such an approach jolly well should put you in a
> defensive position.

In my discharge I'll say I'm not a teacher ;) and in discharge of my 
former one I'll say I don't remember to be urged to follow it always 
neither. But there seems to be always such a noise around it.

>> This is a thing that has always been in my mind about standard 
>> packages. There are some that provide everything you can need, but 
>> lack just the extra "ergonomy" factor. An example: if you want to trim 
>> some string, you need to with two packages and call a function in one 
>> with arguments in the other (Ada.Strings and Ada.Strings.Fixed IIRC). 
>> It may be that I lose time over too tiny details, kind of a neurosis, 
>> but I find these things disturbing.
> 
> 
> And you will find it much more disturbing of course if you don't use USE.
> The proper style is to do WITH/USE of the packages you need, jsut something
> you can cut and paste from anywhere, and then use the stuff without caring
> what package it is in.
> 
> I am sympathetic to providing a renaming (I recommend unary "+") for
> To_Unbounded_String.


More information about the GAP mailing list