| Callable |
|
typedict |
| |
A variable that is declared to be a
Callable
accepts any function or built-in, and its type is whatever
is currently stored in that variable.
Uninitialized
Callable
variables, no matter where they happen to be declared,
always start as
NULL
functions.
Every object that a Yoix program uses is either a
Callable,
Number,
or
Pointer.
| |
| Example: |
The program,
import yoix.stdio.*;
Dummy(arg) {
return(arg+1);
}
Callable c0; // uninitialized
Callable c1 = printf; // built-in
Callable c2 = Dummy; // function
printf("c0=%O\nc1=%O\nc2=%O\n", c0, c1, c2);
c0 = c1;
c1 = c2;
c2 = NULL;
printf("c0=%O\nc1=%O\nc2=%O\n", c0, c1, c2);
prints something like
c0=NULL:FUNCTION
c1=att.research.yoix.YoixModuleStdio.printf(a1, ...)
c2=Dummy(arg)
c0=att.research.yoix.YoixModuleStdio.printf(a1, ...)
c1=Dummy(arg)
c2=NULL:FUNCTION
on standard output.
| | |
| See Also: |
Builtin,
Function,
Number,
Object,
Pointer
|
|
Yoix is a registered trademark of AT&T Inc.
|