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

Add Section for @call #55

Closed
wants to merge 2 commits into from
Closed

Add Section for @call #55

wants to merge 2 commits into from

Conversation

gsquire
Copy link

@gsquire gsquire commented Oct 21, 2020

This patch adds a small section regarding the @call builtin.

Closes #7

This patch adds a small section regarding the call builtin.
chapter-2.md Outdated Show resolved Hide resolved
Copy link
Contributor

@matu3ba matu3ba left a comment

Choose a reason for hiding this comment

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

This can be shortened/made more precise.

@@ -741,6 +741,37 @@ test "precision" {
}
```

# Advanced Function Invocation
Zig offers a `@call` builtin function which gives you more flexibility with which how a function is
Copy link
Contributor

Choose a reason for hiding this comment

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

you can shorten this to what @call does and to me its more about controlling what the compiler does. :)

invoked. There are options to enable or disable tail call optimizations, enable or disable inlining,
as well as force compile time generation.

Example:
Copy link
Contributor

Choose a reason for hiding this comment

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

remove Example:

```zig
const assert = @import("std").debug.assert;

// These functions are effectively the same but are defined and invoked differently.
Copy link
Contributor

Choose a reason for hiding this comment

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

Thats vague. Why are they the same and how invoked differently? Explaining them sounds more understandable to me. Then likely the comments below can also reduced to the key differences.

@gsquire
Copy link
Author

gsquire commented Apr 27, 2022

I think this has gone pretty stale and I'm sure there would be a few merge conflicts. I'm going to close it but if anyone else wants to pick this up, feel free.

@gsquire gsquire closed this Apr 27, 2022
@gsquire gsquire deleted the call branch April 27, 2022 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants