[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Sun, 4 Jan 2009 12:14:31 +1100
Happy New Year Folks,
Programming languages are keen on formal mechanisms to make the scope
of variables clear.
If you write a subroutine in Fortran, everything is local, if you want
global reach, you need to work on common.
In Perl, everything is common, if you want local, you have to work on
it through "my".
In PostScript you have dict and store/def to sort out scope.
Since I write a lot of routines, I like Fortran's solution best.
Groff is a programming language, sort of. I wonder whether already
exist a scope-separating mechanism for
number registers, just I do not know about it, or is there such a
thing in the pipeline in the future?
If you mistype the name of a macro, it won't get executed, and in the
absence of a warning you may think that everything is ok.
I believe that one may get a warning, but I can't find it how.
With number registers, what is the best policy to avoid conflict? By
naming conventions? Weirder and weirder?
I spent two days on a routine that worked well in most cases, but
screwed-up in a few occasions.
I changed the name of one register and everything was all ok.
It could be that my faculties are failing me (you will all get
there :-)), in that case I apologize for stealing your time.
If I have a valid point, please tell me how do you avoid such conflicts.
- [Groff] Local/global/my/common,
Miklos Somogyi <=