diff --git a/newsfragments/195.doc.md b/newsfragments/195.doc.md new file mode 100644 index 0000000000..7a43c1df4d --- /dev/null +++ b/newsfragments/195.doc.md @@ -0,0 +1 @@ +Added descriptions of the `to_mem` and `clone` functions to the spec. \ No newline at end of file diff --git a/spec/index.md b/spec/index.md index 1271a57b2b..9528a155bd 100644 --- a/spec/index.md +++ b/spec/index.md @@ -605,13 +605,13 @@ An *event type* is the type denoted by the name of an [`event` item]. There are three places where data can be stored on the EVM: -- **stack**: 256-bit values placed on the stack that are loaded using `DUP` operations. +- **stack**: 256-bit values placed on the stack that are loaded using `DUP` operations. - **storage**: 256-bit address space where 256-bit values can be stored. Accessing higher storage slots does not increase gas cost. - **memory**: 256-bit address space where 256-bit values can be stored. Accessing higher memory slots increases gas cost. -Each data type described in section 5 can be stored in these locations. How data is stored is +Each data type described in section 5 can be stored in these locations. How data is stored is described in this section. ### 6.1. Stack @@ -621,8 +621,8 @@ The following can be stored on the stack: - base type values - pointers to sequence type values -The size of each value stored on the stack must not exceed 256 bits. Since all base types are less -than or equal to 256 bits in size, we store them on the stack. Pointers to values stored in memory +The size of each value stored on the stack must not exceed 256 bits. Since all base types are less +than or equal to 256 bits in size, we store them on the stack. Pointers to values stored in memory may also be stored on the stack. Example: @@ -639,7 +639,7 @@ All data types can be stored in storage. #### 6.2.1. Constant size values in storage -Storage pointers for constant size values are determined at compile time. +Storage pointers for constant size values are determined at compile time. Example: @@ -656,7 +656,7 @@ given pointer. #### 6.2.2. Maps in storage -Maps are not assigned pointers, because they do not have a location in storage. They are instead +Maps are not assigned pointers, because they do not have a location in storage. They are instead assigned a nonce that is used to derive the location of keyed values during runtime. Example: @@ -667,15 +667,25 @@ bar: map
# bar is assigned a static nonce by the compiler baz: map> # baz is assigned a static nonce by the compiler ``` -The expression `bar[0x00]` would resolve to the hash of both bar's nonce and the key value -.i.e. `keccak256(