[dojo-contributors] [feedback wanted] Preferred Iterationforms

Tom Trenka ttrenka at gmail.com
Wed Apr 12 17:16:14 EDT 2006


No no, I want the feedback, otherwise I would have just done it and told
everyone to f*ck off :)  But what you put up is the reason behind me
thinking "current" as opposed to "next", and it seemed to make sense to use
that as the example.  (i.e. wasn't singling you out).

trt

On 4/12/06, Scott J. Miles <sjmiles at turbophp.com> wrote:
>
> For the record Tom, whatever you decide on goes as far as I'm concerned.
> That is, I can be ignored without offense. :)
>
> >> it was the separation of [current/next] that caused the headaches in
> the
> first place
>
> Ok, I see that Java uses 'next' by convention to mean 'get the next
> object'
> which is logical. .NET iterators work as I described (except they don't
> have
> an atEnd( ) function, afaik).
>
> Regards,
> Scott J. Miles
> TurboAjax Group
> http://www.turboajax.com
>
> ________________________________
>
> From: dojo-contributors-bounces at dojotoolkit.org
> [mailto:dojo-contributors-bounces at dojotoolkit.org] On Behalf Of Tom Trenka
> Sent: Wednesday, April 12, 2006 1:44 PM
> To: dojo dev.
> Subject: Re: [dojo-contributors] [feedback wanted] Preferred
> Iterationforms
>
> Scott,
> I had combined your next and current, and in all honesty I'd prefer to
> keep
> it that way; it was the separation of the two that caused the headaches in
> the first place (the originals used moveNext(), which returned the value
> of
> atEnd, and apparently that caused some misunderstandings about how the
> iterators worked which leads us to where we are today).
>
> Under my suggestion here, current() would return you the current item
> *and*
> advance the internal cursor.  I would provide an "item" property only if
> someone, for some reason, needed to gain another reference to the current
> item in the collection.  But I would expect the dev to be using current()
> and atEnd().
>
> trt
>
> On 4/12/06, Scott J. Miles <sjmiles at turbophp.com> wrote:
>
>         Seems like we went down this road already, but because I can't
> keep
> my mouth shut, I still say this is my personal preference:
>
>         it.atEnd( ) -> boolean EOI indicator
>         it.next( ) -> advance position, return value of it.atEnd()
>         it.current( ) -> return current item
>
> <snip>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.4.1/310 - Release Date: 4/12/2006
>
>
> _______________________________________________
> dojo-contributors mailing list
> dojo-contributors at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-contributors
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20060412/7958d175/attachment.htm 


More information about the dojo-contributors mailing list