Hi Erik,

> that wouldn't be very useful. Though it's good to know it can be done. I
> was more curious if a dump of the PiocLisp ASM was possible, say for a
> top-level REPL call (e.g. '(mapc println (1 2 3))).

Ah, that is the misunderstanding!

An expression like (mapc println (1 2 3)) involves absolutely no such
code at all. In fact, this *IS* the code.

That's why some people call Lisp a high-level assembly language.

Lisp-code like (mapc println (1 2 3)) is directly interpreted. This
sequence of parentheses and characters like 'm', 'a', 'p' etc. are just
a representation of the internal s-epr structure. The reader converts it
to

   +-----+-----+     +-----+-----+     +-----+-----+
   |  |  |  ---+---> |  |  |  ---+---> |  |  |  /  |
   +--+--+-----+     +--+--+-----+     +--+--+-----+
      |                 |                 |
      V                 V                 V
    mapc             println           +-----+-----+     +-----+-----+     
+-----+-----+
                                       |  1  |  ---+---> |  2  |  ---+---> |  3 
 |  /  |
                                       +-----+-----+     +-----+-----+     
+-----+-----+

and, when printed, it shows up as "(mapc println (1 2 3))" again. The
tokens 'mapc' and 'println' here denote references to the cell
structures of those symbols.

These are the internal pointer structures, and there is nothing else
below them. No assembly code to be disassembled. 'print'ing the above
structure *IS* the disassembly.

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to