Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

small discovery

39 views
Skip to first unread message

Bigos

unread,
Mar 15, 2017, 7:22:09 AM3/15/17
to
I was reading a Lisp book and started experimenting with the code in
REPL and I was using SBCL, Emacs and slime. I have defined functions or
entered lambdas in the REPL countless of times in the past, but never
tried to inspect the returned value. To my surprise, I have discovered,
as I was inspecting various aspects of the returned value that it leads
to a window with an assembler version of my code. I have tinkered with
assembler in the past so now I can have a very high-level language and
at the same time be able to reason about performance and space used.

In the past, I have seen different approach, calling
(disassemble 'my-function)
For some reason assembler output of the two versions is slightly
different. The disassemble version cuts off some housekeeping code. The
inspect version also gives you more information about the code. I did
not see it before because I didn't examine the function/code section. I
had to go two levels deep to discover it.

Bigos

unread,
Mar 15, 2017, 10:06:58 AM3/15/17
to
If I move the cursor over name of the function of macro and press M-x
and run slime-inspect I get the same result as if I was evaluating it in
REPL. However it's not so simple. to get the desired result I have to
edit the Emacs mini-buffer a bit.

before
Inspect value (evaluated): adder

after
Inspect value (evaluated): 'adder

Note the quote.
0 new messages