velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: FYI: ListTool as a replacement for ArrayTool
Date Tue, 29 Mar 2005 03:00:22 GMT
agreed on all points.  yet, i'll add this last thought...  on these
methods we're talking about throwing out, rather than just send them
into ether, perhaps we can keep them around on the wiki here or
somewhere in case someone does need/want them.  then i'll just check
in a trimmed-down version for now.

On Mon, 28 Mar 2005 18:00:09 -0800, Shinobu Kawai
<shinobu.kawai@gmail.com> wrote:
> Hi Nathan,
> 
> > > clone() isn't public in List, so I guess I'll need to skip the first
> > > step.
> >
> > oh yeah.  hmm.  so why are we putting it in this tool by default?  is
> > this something you are (or someone else is) using (or has requested)?
> > if not, then i think we shouldn't be trying to  implement it yet.
> > YAGNI, ya know?
> 
> Let's see, I know it wasn't in the original version...
> This method was originally in the PublicFieldUberspect.  I moved it
> here with the length method to put all the array stuff in ArrayTool.
> (Did you know you can't call array.clone() inside VTL?)  Anyways, I
> haven't heard of anyone actually using/needing it, so I guess I can
> throw it away for now.  YAGNI.
> 
> > > Which brings up another question:  Do we want support for other List
> > > methods, like contains() and isEmpty()?  (These two are the only ones
> > > I've ever called from a template.)
> >
> > good question.  and i think the answer is yes.  i don't use contains()
> > much, but i do use $list.isEmpty() a lot.  if we're gonna offer this
> > as (among other things) a way to hide the difference between arrays
> > and lists in a template, then we should probably support these.
> 
> Okay, I'll put them in.  Other methods available upon request.  ;)
> 
> > > Arrays.asList() only works for Object arrays.  We might be getting
> > > primitive arrays as well.  I used to have a whole bunch of
> > > instanceof's.
> >
> > ah. yeah, that makes sense.  i figured i was missing something.  my
> > only question, then, is should we have this return fixed-size lists
> > like Arrays.asList() does?  honest question.  my first instinct is to
> > say that it should, but i'm really not sure if that's important (or
> > even just worth the effort) here.
> 
> I also wonder if anybody wants this method.  I was only using it
> internally at first.  Now, I'm not using it anywhere.  YAGNI applies
> here, too.
> 
> Best regards,
> -- Shinobu
> 
> --
> Shinobu Kawai <shinobu.kawai@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Mime
View raw message