From 0c716e4c6b7c2c44bbfd02b6503cae66af7b7480 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 28 Jan 2022 16:34:41 -0500 Subject: Separate syntax highlighting category for header/body characters ;:? --- docs/doc/oop.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/doc/oop.html') diff --git a/docs/doc/oop.html b/docs/doc/oop.html index af0daaa2..66df070f 100644 --- a/docs/doc/oop.html +++ b/docs/doc/oop.html @@ -71,7 +71,7 @@ View โ‡ {๐•ค l } - Move โ‡ {fromโ€ฟto: + Move โ‡ {fromโ€ฟto: l โ†ฉ TransferยดโŒพ(๐•ฉโŠธโŠ)โŸ(โ‰ ยด๐•ฉ) l } # Move a disk from ๐•จ to ๐•ฉ @@ -137,7 +137,7 @@ Undo โ‡ t.Moveโˆ˜โŒฝโˆ˜Pop } -

This class composes a Tower of Hanoi with an undo stack that stores previous moves. To undo a move from a to b, it moves from b to a, although if you felt really fancy you might define Moveโผ in towerOfHanoi instead with ๐•Šโผ๐•ฉ: ๐•ŠโŒฝ๐•ฉ.

+

This class composes a Tower of Hanoi with an undo stack that stores previous moves. To undo a move from a to b, it moves from b to a, although if you felt really fancy you might define Moveโผ in towerOfHanoi instead with ๐•Šโผ๐•ฉ: ๐•ŠโŒฝ๐•ฉ.

It's also possible to copy several variables and only export some of them, with an export statement. For example, if I wasn't going to make another method called Move, I might have written Viewโ€ฟMove โ† towerOfHanoi and then Viewโ‡. In fact, depending on your personal style and how complicated your classes are, you might prefer to avoid inline โ‡ exports entirely, and declare all the exports at the top.

Self-reference

An object's class is given by ๐•Š. Remember, a class is an ordinary BQN function! It might be useful for an object to produce another object of the same class (particularly if it's immutable), and an object might also expose a field classโ‡๐•ค to test whether an object o belongs to a class c with o.class = c.

-- cgit v1.2.3