Re: [exim] Idea: Predefined macros

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Magnus Holmgren
Data:  
Para: exim-users
Asunto: Re: [exim] Idea: Predefined macros
On Wednesday 02 May 2007 16:05, Marc Perkel wrote:
> Magnus Holmgren wrote:
> > On Wednesday 02 May 2007 15:31, Marc Perkel wrote:
> >> Hope not to sound to ignorant but what is a macro? Can you give an
> >> example of what that would look like?
> >
> > Marc, RTFM. Chapter six.
>
> That's what I thought it was. What confuses me is what's a Predefined
> macro is then and why we would want it?


A predefined macro is what it sounds like: A macro that Exim adds to its list
of macros before reading the configuration file. I gave some examples and
possible reasons for wanting them in my OP.

> I think I see what the controversy is. Because a macro can be any string
> then you have to scan every line for every macro. If there is a
> performance issue then let me suggest this. Have the ability to set a
> compile flag that MACROS have to be UPPERCASE and at least say 6
> characters long. That should cut down on the performance problems.


How do you suppose that would help? The specification says that in every line,
Exim looks for each macro in the order they are defined. That means:

foreach macro m:
  foreach position p:
    check if m starts at p in the current line


That check is usually one or sometimes two comparisons. Making the macro names
longer doesn't change anything. Even if there's a clever algorithm that
yields the same result, your proposed restrictions still won't make any
difference. Besides, you can simply follow those or other rules without the
program code enforcing them.

> Also, why aren't these macros expanded once at load time and stored in
> memory expanded?


Again, occurrences of *previously* defined macros are substituted in *later*
macro definitions. Macros that are not yet defined are not substituted. They
could have been as soon as they *are* defined, but that would alter the
current specified behaviour.

-- 
Magnus Holmgren        holmgren@???
                       (No Cc of list mail needed, thanks)


"Exim is better at being younger, whereas sendmail is better for
Scrabble (50 point bonus for clearing your rack)" -- Dave Evans