Right now, the arguments are named the same way they're named in the
source code. I don't think that convention is worth abandoning.

As for the arguments expected by the iterator: perhaps we could
document these on a separate line in the same EBNF block? I think the
nesting would cause more confusion than it would prevent. Of course,
the arguments are the same for nearly all Enumerable methods, with
inject being one of the few exceptions. So I don't know how I feel
about this idea.

Does anyone else suffer from this annoyance?

Cheers,
Andrew

On Dec 2, 4:50 pm, pedz <[EMAIL PROTECTED]> wrote:
> I'm reading the bungee book and I am often (momentarily) confused by
> the term "iterator".  I noticed that the API documentation on the
> prototype site uses the same term.  If this really is the proper term
> in the Javascript language, thats fine.  I'll shut up.  For me, I
> think of "iterator" as an object that iterates over another object --
> like in C++.  It seems like there must be a better term than iterator.
>
> As a second issue, I'd like to see these 'iterators' properly
> prototyped themselves.  So, instead of:
>
> inject(accumulator, iterator[, context]) -> accumulatedValue
>
> I'd like to see:
>
> inject(accumulator, func(accumulator, element[, index])[, context]) ->
> accumulatedValue
>
> After going through the documentation, I can now glance at this
> specification and immediately remember how to use it, what arguments
> the 'iterator' takes, etc.  Whereas before, I'm likely to forget that
> index is passed along too, etc.
>
> Do others think this would help?  If so, I'd like to try and change
> the Enumerator functions to start with.  Maybe others can change other
> sections.
>
> But, before I start, I wanted to come to some consensus on what to
> call the function.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to