potion
0.2
|
a closure is an anonymous function, without closed values, More...
#include <potion.h>
Public Member Functions | |
PN | potion_closure_code (Potion *P, PN cl, PN self) |
PN | potion_closure_string (Potion *P, PN cl, PN self, PN maxlen) |
PN | potion_closure_arity (Potion *P, PN cl, PN self) |
PN | potion_closure_minargs (Potion *P, PN cl, PN self) |
#define | PN_CLOSURE(x) ((struct PNClosure *)(x)) |
#define | PN_CLOSURE_F(x) ((struct PNClosure *)(x))->method |
#define | PN_FUNC(f, s) potion_closure_new(P, (PN_F)f, potion_sig(P, s), 0) |
Data Fields | |
PN_OBJECT_HEADER | |
PNType vt; PNUniq uniq. More... | |
PN_F | method |
PN | sig |
signature PNTuple More... | |
int | arity |
cached number of declared args, including optional More... | |
int | minargs |
cached number of mandatory args, without optional More... | |
PN_SIZE | extra |
0 or 1 if has code attached at data More... | |
PN | name |
PN | data [] |
PNString. More... | |
a closure is an anonymous function, without closed values,
"send" method, call a method on self by name
self | |
method |
Definition at line 42 of file objmodel.c.
"string" of a function proto, unserializable. without body.
maxlen | (ignored) |
Definition at line 52 of file objmodel.c.
"arity" method, optional args do count.
closure_new aka PN_FUNC sets arity, always use the cached value
Definition at line 64 of file objmodel.c.
Number of mandatory arguments, without optional args.
closure_new aka PN_FUNC sets arity, always use the cached value
Definition at line 71 of file objmodel.c.
int PNClosure::arity |
int PNClosure::minargs |
PN_SIZE PNClosure::extra |