Please note that I am not talking about Generic Type parameters.
For example in Ada I can write a package that needs to be initialized using a value instead of a type. e.g.
generic
Size : Positive;
package Sudokus is
subtype Values is Positive range 1..Size*Size;
type Choice is private;
type Sudoku is private;
procedure Fill(S : out Sudoku);
procedure Init(S : out Sudoku);
procedure Solve(S : in out Sudoku);
procedure Print(S : Sudoku);
Unsolvable_Grid_Error : exception;
And this is how to use it :
package My_Sudoku is new Sudokus(3); -- 3 for 9x9 solver, 4 for 16x16 solver, etc.
I guess there is no equivalent but I find it quite useful.
Is there a reason for this absence ?
The general answer to “why does C# not have feature X” revolves around the benefits of such a feature versus the costs. Benefits are usually obvious, but costs include:
Basically, it shouldn’t be a case of asking why a particular feature isn’t present: it should be a matter of arguing that the benefits of the feature are enormous compared with the costs. Features have to earn their place in the language, and the language designers have set the bar pretty high. (As Anders has put it in the past, every feature starts out with a score of -100, and has to work its way up.)