velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darin Kelkhoff <>
Subject too few arguments to macro errors
Date Mon, 12 Nov 2001 22:57:31 GMT
using 1.2, RC2, we have a macro library file with close to 100 macros in it.  
when the library is parsed, in the log foreach macro we get a message like 

Mon Nov 12 16:27:18 CST 2001   [info] Velocimacro : added new VM : 
#spacer( ) : source = build/com/tsn/templates/primary_macro_lib

there are ~100 lines just like this in sequence in our log.
Then, however, after all these lines a new series of lines appear in the log. 
 they are all in the format:

Mon Nov 12 16:27:18 CST 2001  [error] VM #spacer: error : too few arguments 
to macro. Wanted 3 got 0  -->

these lines always complain that macro had too few arguments, but all our 
templates are rendering fine, all our macro calls are not incorrect.  

when i further inspected the situation, i noticed that for each macro, it 
would generate the error message once for each time that macro was referred 
to in the library file before where that macro was defined.  here's an 

#macro(A $a)
#macro(B $b)
#macro(C $c)

this would generate in the log something like:

...added new VM : #A( )...
...added new VM : #B( )...
...added new VM : #C( )...
...VM #B: error : too few arguments...
...VM #C: error : too few arguments...
...VM #C: error : too few arguments...

at least, thats as closely as i can reproduce the situation.

does this sound like a problem with our code?  has anyone else seen something 
like this?  any ideas?

any help is appreciated,

Darin Kelkhoff
The Sporting News

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message