You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by pl...@netscape.net on 2002/07/23 00:34:17 UTC

Macro pickiness

Being new to Velocity, I just tried to use some wrong syntax
to call a macro, and after I saw the problem, I wondered why
the parser didn't allow what I did.  I had a long macro that
was longer that 80 characters, so I broke up the arguments
with newlines:

#callGM2KMarco('GET_FORM_CMD',
   [$HTTP_METHOD, $MAINSERVER, $SERVLET_BASE,
    $SERVLET_ZONE, $SCREEN_CMD_NAME, $SCREEN_FORM_NAME])

There are two problems that the parser objects to:
  1) The comma after 'GET_FORM_CMD'
  2) The newlines.

Why not allow both?  Or was the idea to sacrifice
flexibility for efficiency?

  --Paul


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Macro pickiness

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 7/22/02 6:34 PM, "plynchnlm@netscape.net" <pl...@netscape.net> wrote:

> Being new to Velocity, I just tried to use some wrong syntax
> to call a macro, and after I saw the problem, I wondered why
> the parser didn't allow what I did.  I had a long macro that
> was longer that 80 characters, so I broke up the arguments
> with newlines:
> 
> #callGM2KMarco('GET_FORM_CMD',
>  [$HTTP_METHOD, $MAINSERVER, $SERVLET_BASE,
>   $SERVLET_ZONE, $SCREEN_CMD_NAME, $SCREEN_FORM_NAME])
> 
> There are two problems that the parser objects to:
> 1) The comma after 'GET_FORM_CMD'
> 2) The newlines.
> 
> Why not allow both?  Or was the idea to sacrifice
> flexibility for efficiency?
> 

We will be allowing for \n in an upcoming release.  For now, the #macro(...)
must be on one line.  Sorry about that.

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>