8000 Support named and optional arguments for struct constructors · Issue #5 · blakeohare/pastel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support named and optional arguments for struct constructors #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you 8B20 agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
blakeohare opened this issue May 28, 2023 · 0 comments
Open

Support named and optional arguments for struct constructors #5

blakeohare opened this issue May 28, 2023 · 0 comments
Labels
New Feature New feature or request

Comments

@blakeohare
Copy link
Owner

Too much of this emerges with the current way of doing things:

new Thing(0, "", 0, 0, null, 0, "", 0, null, null, 1, new List<Foo>(), null, 0, 0.0, 0.0);

Additionally, with named arguments, arguments can be given an optional default value in the struct definition.

new Thing() {
  field1: 0, 
  field2: "", etc... 
};

struct Thing { 
  field1 = 0;
  field2 = "";
  etc.
}
@blakeohare blakeohare added the New Feature New feature or request label May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant
0