-
Notifications
You must be signed in to change notification settings - Fork 237
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
Updated Chapter 12.3.1 #420
Conversation
I don't understand why reading/writing structs would be separated from other types. How to read and write variables from storage is already explained here https://book.cairo-lang.org/ch99-01-03-01-storage-variables.html#reading-from-storage |
I will edit and commit again in a few hours |
Updated now, Please check @enitrat |
Sorry, what I meant was: Storing user defined structs is equivalent to storing any other kind of data. Read and writes are performed in the same way as well which is why I do not understand why there would be a section specifically about structs. Creating a subsection especially for structs, separated from other data types will only create confusion. The example provided do not compile and don't make a lot of sense (why is a Person stored under a variable named For eventual subsequent PRs, you will need to verify that the examples compile first, and then add them to the |
I thought adding the changes will make it clearer to understand how structs annotated with |
It does! There is no difference between compiler-defined types, enums, or structs! You just call |
Oh, I tried that yesterday and I was getting errors. I will confirm and pm you on Telegram. Thank you |
There was no description on how to write user defined struct to storage, and how to read as well. Added these with examples. @enitrat