i’d like to know if it is possible to implement own language constructs (like lock or foreach) in C#?
The idea behind is that i want to mark start and end of a block of operations.
instead of writing
startblock("blockname");
blabla();
andsoon();
endblock();
i’d like to write something like
block("blockname"){
blabla();
test();
}
thank you!
For which purpose do you need it? Just for clarity of writing and clean code?
C# is not extensible language.
With using you can achieve that nicely: