Category talk:Iteration: Difference between revisions

→‎Um...: new section
(Explain why list iteration is not just Map)
(→‎Um...: new section)
 
Line 35:
 
It would be nice to have some examples of OpenMP looping constructs in here (probably as subsections of the C and Fortran language examples) since they're interesting in their own right and are fairly common extensions. —[[User:Dkf|Dkf]] 11:38, 23 May 2009 (UTC)
 
== Um... ==
 
J is all about structured iteration. So much so that early versions of the language (APL) did not incorporate conditionals. Then again, mechanisms like recursion (or at least tail recursion) could also be thought of as a kind of iteration.
 
But I'm not certain I want to be building out pages for every single J control primitive. Most languages just give you a few basic tools and then are unstructured after that and most languages don't have the semantic constructs that drive and control J iteration mechanisms
 
These range from simple things, like prefix and suffix scans:
 
<lang J> <\ 'abcdef'
┌─┬──┬───┬────┬─────┬──────┐
│a│ab│abc│abcd│abcde│abcdef│
└─┴──┴───┴────┴─────┴──────┘
<\. 'abcdef'
┌──────┬─────┬────┬───┬──┬─┐
│abcdef│bcdef│cdef│def│ef│f│
└──────┴─────┴────┴───┴──┴─┘</lang>
 
..to more complex things such as inner product builders, diagonals, and tessellations which have are only meaningful for tables or higher ranked arrays (think of SQL if you want a language with slightly similar constructs).
 
And then there's stuff like [wp:Rank_(J_programming_language)|rank] - I'm not even sure how to write a rosettacode task for a general mechanism like that.
 
Anyways, are we really sure we want an exhaustive treatment of iteration techniques? If so, I guess maybe we should start with "Emulate J Rank", with task examples involving arrays with shapes like 2 2 2 2 2 (the sort of thing that might be used in an fft)? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 06:10, 18 May 2014 (UTC)
6,951

edits