Skip to content
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

feat: Default trait #3046

Closed
spapinistarkware opened this issue May 5, 2023 · 6 comments · Fixed by #3048
Closed

feat: Default trait #3046

spapinistarkware opened this issue May 5, 2023 · 6 comments · Fixed by #3048
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed small

Comments

@spapinistarkware
Copy link
Contributor

Add the Default trait, similar to rust

@spapinistarkware spapinistarkware added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed small labels May 5, 2023
@wraitii
Copy link
Contributor

wraitii commented May 5, 2023

Should this include a breaking-change for Array and Dict?

@spapinistarkware
Copy link
Contributor Author

Yes

@wraitii
Copy link
Contributor

wraitii commented May 5, 2023

As a matter of fact there is already a Default trait builtin, for numeric types. I'm not sure if it has special language support ?

@spapinistarkware
Copy link
Contributor Author

Do you mean Felt252DictValue? If so, then it's something else.

@wraitii
Copy link
Contributor

wraitii commented May 5, 2023

No I mean trait Default<T> in traits.cairo. I have 0 idea what it's used for though.

@spapinistarkware
Copy link
Contributor Author

You are right. We should probably Implement it for Dict and Array:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed small
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants