Prof A Olowofoyeku (The African Chief) wrote:
On 5 Oct 2004 at 0:08, Scott Moore wrote:
Here are IP Pascal's rules for overloads. I just finished implementing it. Yes, it is quite strict. To me, thats less problems going forward.
[....]
overload procedure myproc(i: integer);
Any particular reason for creating YAOS (yet another overload syntax)? I would have thought it reasonable to emulate an already existing and well established syntax (Delphi's).
Just curious ...
Best regards, The Chief
Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/
The reasons were as follows:
1. The overload status of a procedure or function is very important while parsing the header. Therefore it saves work to specify it there.
2. The directive slot after a procedure or function:
procedure x; <directive>;
Was clearly designed such that the directive replaces the body of the procedure or function logically. I.e., both "forward" and "external" both replace the body. Having a new directive that does not replace the body is out of whack with the original intent of the syntax of a directive.
3. Taking the directive spot on a procedure or function is specific to a procedure or function. On a keyword such as "overload", it is certainly possible to extent that to other program items, such as vars or even consts. The spot in front of the item introduction (procedure, function, var, etc). I call a "modifier" and is syntatically universal.
4. IP Pascal began with modifiers in 1980, so there is long a precident for it within the IP family. This is also before Borland Pascal. Originally there were also modifiers "global", and "absolute", although these are long gone now.
Good question, thank you.