-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Create an implicit Sway prelude
#841
Comments
Related: #330 |
Adding some quick thoughts on this as it was raised again recently in #2433: The simplest approach might be to add prelude names while constructing the initial |
From @SwayStar123's desription in #2433:
I will close #2433 in favour of this issue. |
Hm, I think a lot of the above can remain scoped. Address, ContractId, and Identity, Vec, assert, require, and revert should probably be included. But |
In this regard it doesnt make sense to follow Rust, but rather Solidity's design, right? |
That's a good question. This is really subjective. Personally, I dislike magical global functions in general, although data structures are less offensive to me. That's purely subjective though, so let's go ask in the community discord what people think. |
Agree 100%. If we implement the following proposal #2463, then a lot of these functions become methods and they will be automatically available by only importing |
Very good |
Per the discussion on #830, we will eventually want to have a Sway prelude akin to the Rust prelude (https://doc.rust-lang.org/std/prelude/index.html).
The text was updated successfully, but these errors were encountered: