| Pointer |
|
typedict |
| |
A variable that is declared to be a
Pointer
accepts any object that can be dereferenced using dot,
subscript, or pointer notation, and its type is whatever
is currently stored in that variable.
Uninitialized
Pointer
variables, no matter where they happen to be declared,
always start as
NULL
arrays.
Every object that a Yoix program uses is either a
Callable,
Number,
or
Pointer,
so most of the 70 or so types defined in
typedict
create objects that are pointers.
| |
| Example: |
The program,
import yoix.stdio.*;
Pointer p1;
Pointer p2 = "Now is the time";
Pointer p3 = new Color;
printf("p1=%O\np2=%O\np3=%O\n", p1, p2, p3);
p1 = p2;
p2 = p3;
p3 = new Pointer;
printf("p1=%O\np2=%O\np3=%O\n", p1, p2, p3);
prints
p1=NULL:ARRAY
p2=Now is the time
p3=Color[3:0]
blue=0.0
green=0.0
>red=0.0
p1=Now is the time
p2=Color[3:0]
blue=0.0
green=0.0
>red=0.0
p3=NULL:ARRAY
on standard output.
| | |
| See Also: |
Builtin,
Callable,
Function,
Number,
Object
|
|
Yoix is a registered trademark of AT&T Intellectual Property.
|