WalterLederer
WalterLederer
This works now without any language changes: Private Sub EnumerableWithIndex_Test() For Each e In {"A", "B", "C"}.WithIndex With e If .IsFirst Then Console.WriteLine($"First one: { .Index}, { .Value}") Assert.Ok(.Index =...
@Paul M Cohen Error BC30311 Value of type 'IndexStruct(Of MemberDeclarationSyntax)' cannot be converted to 'MemberDeclarationSyntax'. ' node.Members is defined as SyntaxList(Of CSS.MemberDeclarationSyntax) ' SyntaxList is a list of Microsoft.CodeAnalysis.SyntaxNode. '...
@paul1956 > Is there any way to skip forward (similar to i += 1) in a for loop. In some cases I peek at the next item and process 2...
This is possible in VB today in For Each loop: Public Sub EnumerableWithIndex_String_Test() Dim vals = {"A", "B", "C", "D"} For Each e In vals.WithIndex With e Dim out =...
> So, You wrote about 100 lines to do what I am suggesting to do by adding the 5 letters `ByRef` keyword :D > I am not trying to do...
> And then you will hit the higher bad performance wall, especially that loops tend to be large. “The real problem is that programmers have spent far too much time...
> concept is very memory heavy Fixed, see below > Risk 1: It captures a copy of an element Fixed, see below > Risk 2: It presumes the (zero-based) ordinal...
> a real memory pressure issue for large `Structure` types. From https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/choosing-between-class-and-struct : "CONSIDER defining a struct instead of a class if instances of the type are small and commonly...
> I still scratch my head about what use-cases would absolutely also need the index Because I extended my example from #525 and did not remove the Index part >...
> demonstrated a compelling use-case there Comparing multiple List of strings where the first list should be transformed/formatted to the second one by a function which takes a list of...