chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.78k stars 420 forks source link

Documentation: iteratable or iterable? #21046

Open jlbyrne-hpe opened 1 year ago

jlbyrne-hpe commented 1 year ago

Just happened to notice you use both. "iteratable" seems a little more prevalent, but I believe "iterable" is the preferred jargon.

I noticed because I saw "itertatable-call-expression" in https://chapel-lang.org/docs/main/language/spec/expressions.html I should also note that the term is not defined on the page.

bradcray commented 1 year ago

Thanks for filing this, John. My intuition would also be to use 'iterable'.

bradcray commented 1 year ago

Looking at the use cases in more detail, I'm realizing that in recent years, I've been referring to these things as "iterands" or "iterand expressions". Doing a Google search, I see some support for the term, though mostly Google wants to show me results about Ireland. Thinking about why the term seems so natural to me, I think it's because in a + b, a and b are operands (Wikipedia: "the object or quantity that is being operated on"), so in a case like for i in myIter, myIter would be the iterand ("the object or quantity being iterated over").

Anyway, using you as a guinea pig, @jlbyrne-hpe , what would you think if these syntax productions said things like `for index-var-declaration in iterand-expression do statement' and the like?

And then, just to get more opinions on it, I'll ask others to weigh in here as well: :confused: = iteratable [expression] :+1: = iterable [expression] :rocket: = iterand [expression] :eyes: = something else (add a comment)

lydia-duncan commented 1 year ago

I think it makes sense to use both "iterable" and "iterand" but wouldn't say "iterand-expression" personally. To demonstrate why, this is a sentence I would write:

"In the iterable expression for i in myIter, myIter would be the iterand"

I think this is because I view "iterable" as an adjective whereas "iterand" feels more like a noun, so it feels like it fits more naturally when modifying "expression"

jlbyrne-hpe commented 1 year ago

I concur.