Skip to content

Commit 0b2b6ab

Browse files
committed
update documentation
1 parent 556198b commit 0b2b6ab

1 file changed

Lines changed: 17 additions & 20 deletions

File tree

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ It aims to make allocation-free, specialized Linq queries per your type.
1212
Install from NuGet, both [LinqGen](https://www.nuget.org/packages/LinqGen) as library and [LinqGen.Generator](https://www.nuget.org/packages/LinqGen.Generator) as source generator.
1313

1414
```xml
15-
<PackageReference Include="LinqGen" Version="0.0.4-preview" />
16-
<PackageReference Include="LinqGen.Generator" Version="0.0.4-preview" />
15+
<ItemGroup>
16+
<PackageReference Include="LinqGen" Version="0.1.0" />
17+
<PackageReference Include="LinqGen.Generator" Version="0.1.0" />
18+
</ItemGroup>
1719
```
1820

1921
For Unity, you can install as Unity package.
2022
```
21-
https://github.com/cathei/LinqGen.git?path=LinqGen.Unity/Packages/com.cathei.linqgen#v0.0.4-preview
23+
https://github.com/cathei/LinqGen.git?path=LinqGen.Unity/Packages/com.cathei.linqgen#v0.1.0
2224
```
2325

2426
### Any questions?
@@ -79,7 +81,7 @@ The `LinqGen` assembly contains a stub method and types, which helps you autocom
7981
After you write a Linq query with stub methods, then `LinqGen.Generator` runs and replace the stub methods with generated methods.
8082

8183
How is it possible, while modifying user code is not allowed with source generators?
82-
It's because everything `LinqGen.Generator` generates designed to be precede over stub methods on [overload resolution](https://learn.microsoft.com/en-us/dotnet/visual-basic/reference/language-specification/overload-resolution).
84+
It's because everything `LinqGen.Generator` generates designed to be precede over stub methods on [overload resolution](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/expressions#11782-method-invocations).
8385

8486
## Does LinqGen works with Unity Burst compiler?
8587

@@ -100,8 +102,8 @@ public struct LinqGenSampleJob : IJob
100102
int index = 0;
101103

102104
foreach (var item in Input.Specialize()
103-
.Select(new Selector())
104-
.OrderBy(new Comparer()))
105+
.Select(new Selector())
106+
.Order(new Comparer()))
105107
{
106108
Output[index++] = item;
107109
}
@@ -119,9 +121,6 @@ public struct Comparer : IComparer<int>
119121
}
120122
```
121123

122-
### Current limitation with Burst (to-be-fixed)
123-
* Only `NativeArray<T>` and `NativeSlice<T>` is supported for struct enumeration.
124-
125124
## Supported methods (working-in-progress)
126125
### Generations
127126
* Empty
@@ -131,24 +130,21 @@ public struct Comparer : IComparer<int>
131130
### Operations
132131
* Select
133132
* Where
134-
* Cast
135-
* OfType
136-
* Skip
137-
* Take
133+
* Cast, OfType
134+
* Skip, Take
138135
* Distinct
139-
* OrderBy, OrderByDescending
136+
* Order, OrderBy, OrderByDescending
140137
* ThenBy, ThenByDescending
138+
* GroupBy
141139

142140
### Evaluations
143-
* First
144-
* FirstOrDefault
145-
* Last
146-
* LastOrDefault
141+
* ToArray, ToList
142+
* First, FirstOrDefault
143+
* Last, LastOrDefault
147144
* Count
148145
* Sum
149146
* Supports duck typing with `+` operator overload
150-
* Min
151-
* Max
147+
* Min, Max
152148

153149
### Etc
154150
* Specialize
@@ -158,6 +154,7 @@ public struct Comparer : IComparer<int>
158154

159155
## Limitations
160156
* Element or key types that used with LinqGen must have at least `internal` accessibility.
157+
* Struct enumerable should implement `IStructEnumerable<,>` interface.
161158
* LinqGen queries should be treated as anonymous type, it cannot be used as return value or instance member. If you have these needs, use `AsEnumerable()` to convert.
162159
* LinqGen may not work well when `[InternalsVisibleTo]` is used while both assemblies are using LinqGen. It can be solved when [this language feature](https://github.com/dotnet/csharplang/issues/6794) is implemented.
163160

0 commit comments

Comments
 (0)