[Exim] Exim Syntax Language

Top Page
Delete this message
Reply to this message
Author: Marc Perkel
Date:  
To: exim-users
Old-Topics: Re: [Exim] improvments to exim
Subject: [Exim] Exim Syntax Language
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
How about a very differen approach to language syntax:

Procedure MySqlLookup
var Result
   ForEach (h_x-mailer h_from h_to h_subject) do
      Result = Result or MySqlLookup("select " LoopVal " from table ...")
   EndForEach
   Return Result
EndProcedure


;LoopVal is the current value of foreach

it's a very diferent syntax - but it's very readable and intuative.


Andrew - Supernews wrote:

>>>>>>"Avleen" == Avleen Vig <lists-exim@???> writes:
>>>>>>
>
> Avleen> Actually my example was bad. Here's a better one:
>
> Avleen> for i in (h_x-mailer h_from h_to h_subject) match any {
> Avleen> {$i:}{${lookup mysql{select $i from table...}}} {yes}{no}
> Avleen> }
> Avleen> data = :blackhole:
>
>it's not pretty, but you can do something like:
>
>${if !eq{{}\
>         {${sg{x-mailer:from:to:subject:}{\N([^:]+:)\N}\
>             {\N${lookup mysql{select ... '${quote_mysql:${expand:\$h_$1}}' ...}\
>                         {yes}{}}\N}}}}\
>     {yes}{no}}

>
>
>

--