doc/: Use the correct notation for `->' arrows.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 15 Dec 2015 19:15:23 +0000 (19:15 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 29 May 2016 13:40:39 +0000 (14:40 +0100)
I'm still not entirely sure I want to get into this pretty-printing
game, but this way I can at least make the decision in a single place.

doc/concepts.tex
doc/tutorial.tex

index c938c47..b8637e8 100644 (file)
@@ -281,7 +281,7 @@ about these slot members: C code can access them in the usual way.
 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|.
 
@@ -355,9 +355,9 @@ function using @|malloc| might work as follows.
 \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}
index afc6109..bb357d8 100644 (file)
@@ -84,7 +84,7 @@ The main consequences of this are as follows.
   hostile to object-oriented programming as it ever was.  This means that
   you'll end up writing ugly things like
   \begin{prog}
-    thing->_vt->foo.frob(thing, mumble);
+    thing@->_vt@->foo.frob(thing, mumble);
   \end{prog}
   fairly frequently.  This can be made somewhat less painful using macros,
   but we're basically stuck with C.  The upside is that you know exactly what
@@ -197,7 +197,7 @@ bizarre looking runes.  Let's take it one step at a time.
 allocates space for an instance of class @"Greeter".  We're not going to use
 this space directly.  Instead, we do this frightening looking thing.
 \begin{prog}
-  Greeter *g = Greeter__class->cls.init(\&g_obj);
+  Greeter *g = Greeter__class@->cls.init(\&g_obj);
 \end{prog}
 Taking it slowly: @"Greeter__class" is a pointer to the object that
 represents our class @"Greeter".  This object contains a member, named
@@ -208,7 +208,7 @@ the instance, which we use in preference to grovelling about in the
 
 Having done this, we `send the instance a message':
 \begin{prog}
-  g->_vt->greeter.greet(g, stdout);
+  g@->_vt@->greeter.greet(g, stdout);
 \end{prog}
 This looks horrific, and seems to repeat itself quite unnecessarily.  The
 first @"g" is the recipient of our `message'.  The second is indeed a copy of