Generator (computer programming): Difference between revisions

Content deleted Content added
F#: init
F#: 1.9.1
Line 417:
===F#===
{{see|Sequence expression}}
[[F Sharp (programming language)|F#]] provides generators via ''[[sequence expression]]s.,'' since version 1.9.1.<ref name="seq">{{cite web | url = http://blogs.msdn.com/dsyme/archive/2007/09/22/some-details-on-f-computation-expressions-aka-monadic-or-workflow-syntax.aspx | title = Some Details on F# Computation Expressions | accessdate = 2007-12-14}}</ref> These can define a sequence (lazily evaluated, sequential access) via <code>seq { ... }</code>, a list (eagerly evaluated, sequential access) via <code>[ ... ]</code> or an array (eagerly evaluated, indexed access) via <code>[| ... |]</code> that contain code that generates values. For example,
<source lang=fsharp>
seq { for b in 0 .. 25 do