Jelajahi Sumber

Added documentation about the new disassemble method.

Marco Bambini 8 tahun lalu
induk
melakukan
8b67871fbd
1 mengubah file dengan 16 tambahan dan 0 penghapusan
  1. 16 0
      docs/closures.html

+ 16 - 0
docs/closures.html

@@ -91,6 +91,22 @@
 	}
 			</code></pre>
 			
+			<h4 class="section-h4">Disassemble</h4>
+			<p>A closure can be disassembled in order to reveal its bytecode:</p>
+			<pre><code class="swift">
+	func sum (a,b) {
+		return a + b;
+	}
+	
+	func main() {
+		System.print(sum.disassemble());
+	}
+	
+	// Output:
+	// 000000 ADD 3 1 2
+	// 000001 RET 3
+			</code></pre>
+			
 			<p>TO DO: more examples and explanations</p>
 			
          	</div>