Skip to content

Commit 9bd084c

Browse files
committed
Update wording
1 parent 2844391 commit 9bd084c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

c_src/pythonx/fine.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ FINE_INIT("Elixir.MyLib.NIF");
5757
### Encoding/Decoding
5858
5959
Terms are automatically encoded and decoded at the NIF boundary based
60-
on the function signature. You may also want to invoke encode/decode
61-
directly:
60+
on the function signature. In some cases, you may also want to invoke
61+
encode/decode directly:
6262
6363
```cpp
64+
// Encode
6465
auto message = std::string("hello world");
6566
auto term = fine::encode(env, message);
66-
```
6767
68-
```cpp
68+
// Decode
6969
auto message = fine::decode<std::string>(env, term);
7070
```
7171

@@ -220,8 +220,8 @@ Structs can be particularly convenient when using NIF resource objects.
220220
When working with resources, it is common to have an Elixir struct
221221
corresponding to the resource. In the previous `Generator` example,
222222
you may define an Elixir struct such as `%MyLib.Generator{resource: reference}`.
223-
Instead of passing and returning the reference to the NIF, you can
224-
pass the struct itself:
223+
Instead of passing and returning the reference from the NIF, you can
224+
pass and return the struct itself:
225225

226226
```cpp
227227
#include <fine.hpp>
@@ -329,7 +329,7 @@ fine::raise(env, ExMyError{42})
329329
### Atoms
330330

331331
It is preferable to define atoms as static variables, this way the
332-
corresponding terms are create once, at NIF load time.
332+
corresponding terms are created once, at NIF load time.
333333

334334
```cpp
335335
namespace atoms {

0 commit comments

Comments
 (0)