« Home » « Learn » « Download » « Github »

logo

Cello High Level C

Methods

call

#define call(self, ...)
var call_with(var self, var args);

Call the object self with arguments args.

Examples

Usage

var increment(var args) {
  struct Int* i = get(args, $I(0));
  i->val++;
  return NULL;
}

var x = $I(0);
show(x); /* 0 */
call($(Function, increment), x);
show(x); /* 1 */

Call


Callable

The Call class is used by types which can be called as functions.

Definition

struct Call {
  var (*call_with)(var, var);
};

Implementers

  • Function |     Function Object
  • Map |     Apply Function to Iterable
  • Thread |     Concurrent Execution

Back