|
@@ -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>
|