+ # Print the result of adding `self` to `self.fib` with callbacks from C
+ #
+ # This method illustrates many forms of callbacks from C,
+ # but it would have been better implemented in Nit (as done by `bar`).
+ #
+ # It is recommended to avoid callbacks when possible, use each language according to their strengths.
+ # Nit is better than C to call methods and manipulate objects.
+ # C has easy access to system functions, native libraries and it does low-level stuff.
+ #
+ # The implementation calls:
+ # * the local `fib` method,
+ # * the `+` operator, a method of `Int`,
+ # * `to_s`, a method of all objects,
+ # * `String.to_cstring`, a method of `String` to get as a `char*`.
+ fun foo import fib, +, to_s, String.to_cstring `{
+ long self_fib = Int_fib(self);
+ long self_plus_fib = Int__plus(self, self_fib);