Browse Source

Update documentation with latest changes

feat/clarity-updates
Ludo Galabru 5 years ago
committed by GitHub
parent
commit
fe4bab8db9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      _core/smart/clarityRef.md

14
_core/smart/clarityRef.md

@ -61,7 +61,9 @@ Supports values of `'true` or `'false`.
### Buffer type ### Buffer type
Buffer types represent fixed-length byte buffers. Currently, the only way to construct a Buffer is using string literals, for example `"alice.id"` or `hash160("bob.id")` Buffer types represent fixed-length byte buffers. A Buffer can either be constructed using:
- String literals, for example `"alice.id"` or `hash160("bob.id")`,
- Hexadecimals literals, for example `0xABCDEF`.
All of the hash functions return buffers: All of the hash functions return buffers:
@ -73,7 +75,7 @@ The block properties `header-hash`, `burnchain-header-hash`, and `vrf-seed` are
### List type ### List type
Clarity supports lists of the atomic types. However, the only variable length lists in the language appear as function inputs; there is no support for list operations like append or join. Clarity supports lists of the atomic types. However, the only variable length lists in the language appear as function inputs.
### Principal type ### Principal type
@ -100,19 +102,19 @@ This allows for creating named tuples on the fly, which is useful for data maps
<th>Description</th> <th>Description</th>
</tr> </tr>
<tr> <tr>
<td><code>(fetch-entry map-name key-tuple)</code></td> <td><code>(map-get map-name key-tuple)</code></td>
<td>Fetches the value associated with a given key in the map, or returns <code>none</code> if there is no such value.</td> <td>Fetches the value associated with a given key in the map, or returns <code>none</code> if there is no such value.</td>
</tr> </tr>
<tr> <tr>
<td><code>(set-entry! map-name key-tuple value-tuple)</code></td> <td><code>(map-set! map-name key-tuple value-tuple)</code></td>
<td>Sets the value of key-tuple in the data map</td> <td>Sets the value of key-tuple in the data map</td>
</tr> </tr>
<tr> <tr>
<td><code>(insert-entry! map-name key-tuple value-tuple)</code></td> <td><code>(map-insert! map-name key-tuple value-tuple)</code></td>
<td>Sets the value of key-tuple in the data map if and only if an entry does not already exist.</td> <td>Sets the value of key-tuple in the data map if and only if an entry does not already exist.</td>
</tr> </tr>
<tr> <tr>
<td><code>(delete-entry! map-name key-tuple)</code></td> <td><code>(map-delete! map-name key-tuple)</code></td>
<td>Deletes key-tuple from the data map.</td> <td>Deletes key-tuple from the data map.</td>
</tr> </tr>
</table> </table>

Loading…
Cancel
Save