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

Enums and docs update #77

Merged
merged 12 commits into from
Aug 17, 2021
Merged

Enums and docs update #77

merged 12 commits into from
Aug 17, 2021

Conversation

FelonEkonom
Copy link
Member

No description provided.

@FelonEkonom FelonEkonom requested review from mat-hek and mickel8 June 30, 2021 12:58
@FelonEkonom FelonEkonom self-assigned this Jun 30, 2021
Comment on lines 95 to 108
Elixir type | Native type
--- | ---
`atom` | `char *`
`bool` | `int`
`float` | `double`
`int` | `int`
`int64` | `int64_t`
`payload` | `UnifexPayload`
`pid` | `UnifexPid`
`state` | `UnifexState *`
`string` | `char *`
`uint64` | `uint64_t`
`unsigned` | `unsigned int`
`[int]` | `int *`, `unsigned int`
Copy link
Member

Choose a reason for hiding this comment

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

I think this list should rather be a part of documentation, not the tutorial

@@ -80,12 +80,100 @@ UNIFEX_TERM foo(UnifexEnv* env, int num) {
return foo_result_ok(env, num);
}
```
You can see, that we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is atom with type `label` in returned tuple. Type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on number and types of rest of elements in the returned tuple (see the table below).

It is a very simple C code that always returns the same number it gets.
Copy link
Member

Choose a reason for hiding this comment

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

since you put a paragraph above, that sentence sounds weird

Copy link
Member

Choose a reason for hiding this comment

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

seems not fixed

@@ -80,12 +80,100 @@ UNIFEX_TERM foo(UnifexEnv* env, int num) {
return foo_result_ok(env, num);
}
```
You can see, that we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is atom with type `label` in returned tuple. Type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on number and types of rest of elements in the returned tuple (see the table below).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You can see, that we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is atom with type `label` in returned tuple. Type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on number and types of rest of elements in the returned tuple (see the table below).
As you can see, we used function `foo_result_ok` in the implementation above. For every tuple, that might be returned from our Unifex function (in this case, it is `foo`), there will be generated implementation of result function named `[orginal_function_name]_result_[label]`, where `label` is an atom with type `label` in returned tuple. The type of the first argument of this function will be `UnifexEnv*`, number and types of the rest of the arguments will depend on the number and types of rest of elements in the returned tuple (see the table below).

Please use Grammarly to verify English.

@FelonEkonom FelonEkonom requested a review from mat-hek August 17, 2021 10:36
@FelonEkonom FelonEkonom merged commit f3a6272 into master Aug 17, 2021
@FelonEkonom FelonEkonom deleted the enums-update branch August 17, 2021 11:23
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.

2 participants