On-Demand Macros issue

Fran=?utf-8?B?w6c=?=ois Laupretre francois.laupretre-prestataire at calyon.com
Fri May 27 18:58:02 CEST 2005


Sorry but I don't understand what you mean when you say that 'every C
preprocessor does it properly' ?

You can arbitrarily decide to process macros inside out, but it means that a
string like '$string1$string2$string3$' would be expanded as
'($string1($string2$)string3$)', which is incompatible with the current way
of expanding such a string. 

If I am wrong, please let me know because it would be a very nice feature to
expand the variables recursively.

> -----Original Message-----
> From: Andreas Ericsson [mailto:ae at op5.se] 
> Sent: Friday, May 27, 2005 10:49 AM
> To: nagios-users at lists.sourceforge.net
> Subject: Re: RE : [Nagios-users] Re: On-Demand Macros issue
> 
> 
> François Laupretre wrote:
> >>From: Bryan Loniewski [mailto:brylon at jla.rutgers.edu]
> >>
> >>Would others find this useful if a patch is applied?
> >>
> >>
> >>>       command_line    $USER2$/foo $HOSTADDRESS:$ARG1$$ # Where 
> >>>$ARG1$=some_host_name
> > 
> > 
> > Unfortunately, as the macro starting and ending tags are 
> the same ($), 
> > I think that you cannot implement such an extension in an 
> unambiguous 
> > way.
> 
> Considering every C preprocessor does it properly, I'd say 
> it's not only 
> possible but also a fairly straightforward approach. Macros 
> just have to 
> be expanded inside out, instead of outside/none, and expanded 
> recursively.
> 
> The biggest problem would probably be performance.
> 
> 
> > Here is an example:
> > 
> > If you get :
> > 
> > $HOSTADDRESS:pre$ARG1$post$
> > 
> 
> If $ARG1$ is expanded prior to $HOSTADDRESS:therest$ this 
> wouldn't be a 
> problem.
> 
> > It is impossible to choose between :
> > 
> > 	($HOSTADDRESS:pre$)ARG1($post$)
> > And	($HOSTADDRESS:pre($ARG1$)post$)
> > 
> > And it is still harder if you get something like 
> > '$HOSTADDRESS:pre$ARG1$ARG2$'.
> > 
> 
> That would be '$HOSTADDRESS:pre$ARG1$$ARG2$$', as the 
> complete name of 
> each macro must be included (the last $ is to close the $ in 
> the beginning).
> 
> > To conclude, unless you define some new tags for macro expansion, I 
> > think that this extension is not possible. And defining 
> some new tags 
> > would bring many compatibility problems.
> > 
> 
> Bah.
> 
> -- 
> Andreas Ericsson                   andreas.ericsson at op5.se
> OP5 AB                             www.op5.se
> Lead Developer
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by Yahoo.
> Introducing Yahoo! Search Developer Network - Create apps 
> using Yahoo! Search APIs Find out how you can build Yahoo! 
> directly into your own Applications - visit 
> http://developer.yahoo.net/?fr=offad-ysdn-> ostg-q22005
> 
> _______________________________________________
> 
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS 
> when reporting any issue. 
> ::: Messages without supporting info will risk being sent to /dev/null
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050527/04449f09/attachment.html>
-------------- next part --------------
Ce message et ses pièces jointes (le "message") est destiné à l'usage    
exclusif de son destinataire.                                            
Si vous recevez ce message par erreur, merci d'en aviser immédiatement   
l'expéditeur  et de le détruire ensuite. Le présent message  pouvant  
être altéré à notre insu,  CALYON Corporate and Investment Bank                              
ne peut pas être engagé par son contenu. Tous droits réservés. 
          
This message and/or any  attachments (the "message") is intended for     
the sole use of its addressee.                                            
If you are not the addressee, please immediately notify the sender and    
then destroy the message.  As this message and/or any attachments may 
have been altered without our knowledge,  its content  is not legally 
binding on CALYON Corporate and Investment Bank. All rights reserved.                                                                


More information about the Users mailing list