-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffa07bc
commit 0f18124
Showing
3 changed files
with
39 additions
and
14 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
Docs/SuperLinq.Docs/apidoc/SuperLinq.SuperEnumerable.Generate.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
uid: SuperLinq.SuperEnumerable.Generate``1(``0,System.Func{``0,``0}) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to generate a sequence from a generator function using `Generate`. | ||
[!code-csharp[](SuperLinq/Generate/Generate.linq#L6-)] |
17 changes: 17 additions & 0 deletions
17
Docs/SuperLinq.Docs/apidoc/SuperLinq/Generate/Generate.linq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
// Generate a sequence using a generator function | ||
var result = SuperEnumerable | ||
.Generate(1, n => n * 2) | ||
.Take(10); | ||
|
||
Console.WriteLine( | ||
"[" + | ||
string.Join(", ", result) + | ||
"]"); | ||
|
||
// This code produces the following output: | ||
// [1, 2, 4, 8, 16, 32, 64, 128, 256, 512] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters