Content deleted Content added
m Maintain {{WPBS}}: 3 WikiProject templates. Keep majority rating "Start" in {{WPBS}}. Remove 3 same ratings as {{WPBS}} in {{WikiProject Computing}}, {{WikiProject Computer science}}, {{WikiProject Software}}. Tag: |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 1:
{{Talk header}}
{{WikiProject Computing}}▼
{{WikiProject banner shell|class=Start|
▲{{WikiProject Computing|importance=Low}}
{{WikiProject Computer science|importance=Mid}}
{{WikiProject Software|importance=Low}}
}}
==Origin of the concept==
Line 47 ⟶ 51:
(excluding languages which ''can'' implement generator functionality (via more general support for continuations or coroutines), but don't really support them as a native idiom)
*[[Aldor]] [http://www.aldor.org/docs/HTML/chap9.html]
*[[Icon programming language|Icon]] (already done)
*[[Panacea programming language|Panacea]] (mentioned in [[Randall Hyde]]'s ''Art of Assembly Language'', [http://webster.cs.ucr.edu/AoA/DOS/ch12/CH12-6.html Ch. 12.5 Iterators])
*[[Unicon programming language|Unicon]]
*[[Raku (programming language)|Raku]] ... lazy lists?
== Generators versus continuations ==
Line 115 ⟶ 121:
The Generator expression example for Icon can be simplified and does not require a co-expression.
<
local j
every j := (|seq(0) \ 20) ^2 do # Produced the first 20 squares
write(j)
</syntaxhighlight>
If the idea is to demonstrate really what Icon can do in terms of using generators outside a loop construct, the following may be a better example
<
# find the first matching element
a := [1,2,3,4]
b := [5,6,2,7]
c := ( !a = !b ) | &null # assign first matching element, or set to &null
</syntaxhighlight>
[[User:CheyenneWills|CheyenneWills]] ([[User talk:CheyenneWills|talk]]) 20:01, 16 June 2010 (UTC)
|