For example, if @|MyClass| has the nickname @|mine|, and defines a slot @|x|
of type @|int|, then the simple function
\begin{prog}
- int get_x(MyClass *m) \{ return (m->mine.x); \}
+ int get_x(MyClass *m) \{ return (m@->mine.x); \}
\end{prog}
will extract the value of @|x| from an instance of @|MyClass|.
\begin{prog}
void *new_instance(const SodClass *c) \\
\{ \\ \ind
- void *p = malloc(c->cls.initsz); \\
+ void *p = malloc(c@->cls.initsz); \\
if (!p) return (0); \\
- c->cls.init(p); \\
+ c@->cls.init(p); \\
return (p); \- \\
\}
\end{prog}