Content deleted Content added
m Signing comment by 75.73.1.89 - "→Fuzzy definition?: " |
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: |
||
(5 intermediate revisions by 5 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)
Line 282 ⟶ 288:
The definition at the very start of the article is very hard to parse. It overuses analogy and is quite confusing. Perhaps later in the intro section it might be comprehensible, but at 0300 in the morning w/ a non-working GRUB2 EFI configuration hanging over my head, I just ditched trying to read the article and leave this short note waiting for the rest of my update to download.
What you should not say is that it is like an array, since it isn't anything like an array. You might use a generator to access values in an array, but it isn't the array. You can use a bucket to empty a bathtub full of soapy water, but don't confuse the bucket with the bathwater (and for heaven's sake, take the baby out first!).
Sorry, but most of my programming experience is with Java (w/o generators as a built in, but I am sure I have had to write thousands of them w/o ever knowing what the hell I was doing), or I would try my hand at a new intro. <!-- Template:Unsigned IP --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/75.73.1.89|75.73.1.89]] ([[User talk:75.73.1.89#top|talk]]) 09:16, 13 January 2017 (UTC)</small> <!--Autosigned by SineBot-->
|