velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Weinstein <JWeinst...@SeeBeyond.com>
Subject RE: What's in the future for Velocity?
Date Thu, 10 Oct 2002 16:53:06 GMT
I'd like to see the ability to denote the scope of variables.

I'd especially like to have a local scope inside of a macro.

#setlocal () perhaps

I think there are other scoping issues that I would consider although I am
not sure how velocity is handling scope for instance when a file is
#include(d) or #parse(d) since I have not used these features.

I'd also like to have an
#endif
#endmacro
#endforeach
for readability.
(Name not important, just like to know what construct is ending)

See example below for scoping issue.

Calling the #macro sets $macroTemp, $macroI, $macroK globally. This makes it
difficult to call another #macro from within a #macro do to possible naming
conflicts.

#**
 * Iteratively applys the template to elements in the list.
 * #set ($values = ["a", "b", "c"])
 * #applyTemplateToList1 ($buf "$x" $x $values ", ")
 * $buf
 * output> a, b, c
 *#
#macro (applyTemplateToList1 $retVal $template $x $list $delim)
#set ($macroTemp = "")
##
#set ($macroK = $list.size() - 1)
##
#if ($macroK >= 0)
##
#foreach ($macroI in [0..$macroK])
## Bind variable to template
#set ($x = "$!list.get($macroI)")
##
#if ($macroI < $macroK)
#set ($macroTemp = "$macroTemp$template$delim" )
#else
#set ($macroTemp = "$macroTemp$template")
#end
##
#end
##
#end
##
#set ($retVal = $macroTemp)
#end

-----Original Message-----
From: Christoph.Reck@dlr.de [mailto:Christoph.Reck@dlr.de] 
Sent: Thursday, October 10, 2002 4:08 AM
To: Velocity Users List
Subject: Re: What's in the future for Velocity?

Exaclty those two are the open issues I see:

+1 for enhnaced White space gobbling
+1 for multi line directives


Paul Smith wrote:
> Actually I've just thought of the one thing that does bug me, and I know
has
> bugged others (wasn't paying attention to the previous threads but I
> remember there being a large # of posts about it) and that is:
> 
> White space gobbling (or lack there of).
> 
> We need something like what VB has when breaking a string over multiple
> lines ( &_ ).  Something that says to velocity "now, I _know_ there is a
> CR/LF following this, but just ignore it ok!"
> 
> cheers,
> 
> Paul
> 
> -----Original Message-----
> From: Martin Jacobson [mailto:martin_j@libero.it]
> Sent: Thursday, 10 October 2002 5:52 PM
> To: Velocity Users List
> Subject: Re: What's in the future for Velocity?
> 
> 
> Paul Smith wrote:
> 
> 
>>Hi All,
>>
>>Personally I can't think of many (if any) thing that I would want improved
>>in Velocity, but I'm just curious if the dev team (I assume it's not just
>>Geir?!) has anything cool in the works (or even ideas) for Velocity the
>>would like to share.  I know the goal  in Velocity is it's simplicity and
> 
> by
> 
>>adding more into it you defeat that goal, but just wondering.
>>
>>Thanks again for a great product.
>>
> 
> 
> 
> ... and in the same vein, is there a 'wish list' that we can contribute
to?
> For instance, it would make my life easier if #macros could accept 
> variable numbers of arguments a la JavaScript, or, at least, interpret 
> missing arguments as null strings rather than throwing parse errors.
> 
> But, I have to agree with Paul that Velocity's minimalist design is a 
> major strength of the product, and I wouldn't want that to change!
> 
> Martin
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>
> 
> 

-- 
:) Christoph Reck


--
To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message