[Lazarus] RFC: Code tools Feature?

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Thu Mar 27 11:56:26 CET 2014


Michael Van Canneyt wrote:

>> If the compiler could track the current procedure (or function, or 
>> class.method etc.) name, then couldn't that be done with a macro? Then 
>> the app source would be a less-obtrusive:
>>
>> Procedure TMyClass.MyMethod;
>>
>> begin_logged
>>
>> end_logged;
> 
> I prefer not to use macros. This is not C.
> I like to see explicitly what is happening.
> Pascal macros are also not customizable/parametrizable (as the IDE 
> macros are).

Would you be happier if it were described or implemented like an ALGOL 
control card? This is a clear case of something which is needed fairly 
regularly by all users of the language, rather than just by those who 
use Lazarus, and having a decent way to implement it at the language 
level is preferable even if there were an IDE shortcut.

Rejecting a feature out-of-hand simply because it's "not invented here" 
is highly undesirable in my opinion. Everybody agrees that C has 
problems and many agree that even the current C++ standard is basically 
putting lipstick on a pig, but that's no reason to avoid coopting and 
reimplementing the good bits /properly/.

Besides which, macro replacement predates C by many years. Don't get me 
going on that one since I risk being an olympic-grade bore :-)

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list