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

Update structure-of-a-contract.rst #3977

Closed
wants to merge 1 commit into from
Closed

Update structure-of-a-contract.rst #3977

wants to merge 1 commit into from

Conversation

aj07
Copy link
Contributor

@aj07 aj07 commented Apr 23, 2018

No description provided.

@aj07
Copy link
Contributor Author

aj07 commented Apr 23, 2018

#3541

#3967

@@ -109,7 +109,7 @@ Struct Types
=============

Structs are custom defined types that can group several variables (see
:ref:`structs` in types section).
:ref:`structs` in types section) and can be accessed by single name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use full stops to end sentences.

Do you want to highlight "single" in any way?

@@ -123,6 +123,16 @@ Structs are custom defined types that can group several variables (see
uint vote;
}
}

If you want to create a new struct variable inside a function,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -123,6 +123,16 @@ Structs are custom defined types that can group several variables (see
uint vote;
}
}

If you want to create a new struct variable inside a function,
and then add push it to an array, then you should create it in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not mention whether the struct variable is created inside a function, but rather only mention the intention to add a new element to a struct array.

and then add push it to an array, then you should create it in
the storage space not memory space ::

MyStruct memory newStruct;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example actually creates a memory object.

@aj07 aj07 mentioned this pull request May 2, 2018
@chriseth
Copy link
Contributor

I don't see any value in keeping this pull request open.

@chriseth chriseth closed this May 15, 2018
@aj07
Copy link
Contributor Author

aj07 commented May 15, 2018

@chriseth Please keep this open. Next updated patch would be sent here. Else I would have to create new patch

@chriseth
Copy link
Contributor

@aj07 pleise either reopen or create a new one if you add something here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants