-
Notifications
You must be signed in to change notification settings - Fork 23
User defined default values #233
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 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
Comments
I like this idea, since AFAIK the compiler already has a concept of |
Maybe related to:
|
Great feature, but the syntax seems overly complex to me for something whose effect is so simple. How about |
On another though maybe using |
User manual defines how variables are initialized. In fact, memory used by the variables is 0-filled.
Proposal
The special func
default(t: typedesc[T]): T
can be defined by the user to specify a different default value. When it exists, the compiler will call this proc to initialize variables of typeT
. In such case, 0-filled memory does not occur and it's replaced bydefault
calls.Justification
Warning: Cannot prove that 'f' is initialized. This will become a compile time error in the future. [ProveInit]
[ProveInit]
warnings can be corrected by users.The text was updated successfully, but these errors were encountered: