[GAP] Question about subprogram syntax

Marius Amado Alves marius at amado-alves.info
Tue Feb 21 17:09:46 CET 2006


> "Why don't parameter-less subprograms have empty brackets like C or 
> Java?
> The code would be easier to read and maintain. It would be also 
> possible to
> have a variable and a procedure with the same name."
>
> I really don't what to answer because I think the same. Wasn't Ada 
> thought
> as "write once, read many times" or "Ada enhances readability"? Why 
> inherit
> this from Pascal?
>
> Have you think about changing it (suppossing using always brackets was 
> a
> good idea)? I  know the change would make old Ada'95 and Ada'83 code
> incompatible and that Ada 200X is going to be an Amendment rather than 
> a
> Revision, but still ...

I doubt everybody thinks that

   Empty_Brackets();

would

   Enhance_Readability;

I don't.

OTOH I don't see how adding empty brackets as an option to the language 
would create incompatibility. Ada does not have any construct "()" does 
she?

Of course this is academic, or at most Ada 2015 stuff.

Anyway, even if technically feasible, this change (as an option) would 
create the potential for two styles, and that might hurt readability 
across teams a bit.

Goes without saying that making () mandatory is unthinkable, as 
compatibility is infinitely higher in Ada requirements than getting a C 
looks.



More information about the GAP mailing list