Skip to content

Commit 7b1e7dc

Browse files
authored
Update docs for Tolk v0.12 (#1153)
* Update docs for Tolk v0.12
1 parent 1d1054a commit 7b1e7dc

File tree

8 files changed

+566
-311
lines changed

8 files changed

+566
-311
lines changed

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@
364364
"deployment",
365365
"docs/learn/tvm-instructions/instructions.csv",
366366
"docs/learn/tvm-instructions/generate_md.py",
367+
"docs/v3/documentation/smart-contracts/tolk/tolk-vs-func/stdlib.md",
367368
"sidebars.js",
368369
"sidebars",
369370
"i18n",

docs/v3/documentation/smart-contracts/tolk/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ import Feedback from '@site/src/components/Feedback';
55
When new versions of Tolk are released, they will be mentioned here.
66

77

8+
## v0.12
9+
10+
1. Structures `struct A { ... }`
11+
2. Generics `struct<T>` and `type<T>`
12+
3. Methods `fun Point.getX(self)`
13+
4. Rename stdlib functions to short methods
14+
15+
816
## v0.11
917

1018
1. Type aliases `type NewName = <existing type>`

docs/v3/documentation/smart-contracts/tolk/overview.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ but leaving all low-level optimizations untouched. Think of Tolk as the next‑g
1515
import "storage.tolk"
1616
1717
fun loadData() {
18-
ctxCounter = getContractData().beginParse().loadUint(32);
18+
ctxCounter = contract.getData().beginParse().loadUint(32);
1919
}
2020
2121
fun onInternalMessage(msgValue: int, msgFull: cell, msgBody: slice) {
@@ -101,7 +101,7 @@ If you know FunC and want to try a new syntax, your way is:
101101

102102
1. Read [Tolk vs FunC: in short](/v3/documentation/smart-contracts/tolk/tolk-vs-func/in-short).
103103
2. With a blueprint, create a new Tolk contract (for example, a counter) and experiment around it. Remember that almost all stdlib functions are renamed to ~~verbose~~ clear names. Here is [a mapping](/v3/documentation/smart-contracts/tolk/tolk-vs-func/stdlib).
104-
3. Try a [converter](https://github.com/ton-blockchain/convert-func-to-tolk) for your existing contracts or one from [FunC Contracts](/v3/documentation/smart-contracts/contracts-specs/examples). Remember that contracts written in Tolk from scratch look nicer than auto-converted ones. For instance, using logical operators instead of bitwise tremendously increases code readability.
104+
3. Try a [converter](https://github.com/ton-blockchain/convert-func-to-tolk) for your existing contracts or one from [FunC contracts](/v3/documentation/smart-contracts/contracts-specs/examples). Remember that contracts written in Tolk from scratch look nicer than auto-converted ones. For instance, using logical operators instead of bitwise tremendously increases code readability.
105105

106106
## How to try Tolk if you don't know FunC
107107

@@ -142,7 +142,6 @@ The first released version of Tolk is v0.6, emphasizing [missing](/v3/documentat
142142
Here are some points to investigate:
143143

144144
- type system improvements
145-
- structures and generics
146145
- auto-pack structures to/from cells, probably integrated with message handlers
147146
- methods for structures, generalized to cover built-in types
148147
- easier message sending

0 commit comments

Comments
 (0)