syntactic sugar for getters/setters
iAndyHD3 opened this issue · 1 comments
iAndyHD3 commented
since public fields are not allowed, this means one is forced to write setters and getters for every single member. Doing so is a lot of work, especially with structures with many fields.
Suggestion:
syntactig sugar for getters/setters, perhaps something similar to c#?
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
pfusik commented
What do you mean by "a lot of work" ? If it's a few dozen fields, it's a one-time investment of a few minutes.
I consider introducing C#-style properties to Fusion. The goal is not to reduce how much you type, but ability to emit code that feels natural to the target language. And especially for C# you'd want properties.