velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Why cant I pass "arrays" to object methods?
Date Mon, 12 Feb 2001 11:33:00 GMT
Christoph Reck wrote:
> Geir, I do like the fact that its now an array list, but it will cause
> some problems for objects with exisiting methods that are taking Object[]
> as a parameters. The above workaround is sufficient. but makes
> it hard to do a direct call:
>         #set( $list = $tools.split($aStringRef, [$CRLF, $NL, ',']) )
> A different solution would have been to allow accessing public fields
> directly, e.g.
>         $array.length
> Just my 2c, and not very important.

I know, and that was tossed about a little.  But, we don't allow access
to public fields (thats kinda poor practice, right?) and the richness
and flexibility of ArrayList seems to make up for the extra step of 
    #set( $goo = [$CRLF, $NL, ','] )
    #set( $list = $tools.split($aStringRef, $goo) )



Geir Magnusson Jr.                     
Velocity : it's not just a good idea. It should be the law.

View raw message