From: Texaner
Subject: Slime and Trace
Date: 
Message-ID: <1148725100.055742.49860@u72g2000cwu.googlegroups.com>
Hello,

I'm not very experienced with Slime/Emacs. Until now I have used Lisp
Box with CLisp. But the Lisp Boxes use an old version of Slime and
changed options in Emacs cannot be saved.

So I tried to install a Slime/Emacs package on my own (on Mac OS X)
with the help of the following link:

http://blog.zenzoa.com/articles/search?q=installing


This link suggests to use OpenMCL so I tried a "new" lisp.

The problem that I have now is that "Trace" does not work properly.

If I use this feature the Tracer only prints the first calling of my
traced function and the last returen value (of a recursive function).

I'm not able to inspect the callings and values of the several steps in
a recursive function as I could with my Lisp Box-Installation. It
printed: 1. Trace, 2. Trace and so on.

So my question is:
Is it a problem of my installation or is it a problem of OpenMCL?

Thanks in advance for your answer.

From: Texaner
Subject: Re: Slime and Trace
Date: 
Message-ID: <1148817157.603774.3830@u72g2000cwu.googlegroups.com>
Yes, you are right! Thanks.

If I do sharpquote I e.g. get this:

CL-USER> #'ek
#<Compiled-function EK #x8B543EE>

I did not expect that slime compiles when I "only" use evaluate!

How can I change this?
From: Pascal Bourguignon
Subject: Re: Slime and Trace
Date: 
Message-ID: <87wtc61agt.fsf@thalassa.informatimago.com>
"Texaner" <·········@web.de> writes:

> Yes, you are right! Thanks.
>
> If I do sharpquote I e.g. get this:
>
> CL-USER> #'ek
> #<Compiled-function EK #x8B543EE>
>
> I did not expect that slime compiles when I "only" use evaluate!
>
> How can I change this?

Not slime. SBCL. There's no interpreter in SBCL.
Try CLISP or CMUCL if you want an interpreter.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

CONSUMER NOTICE: Because of the "uncertainty principle," it is
impossible for the consumer to simultaneously know both the precise
location and velocity of this product.
From: Texaner
Subject: Re: Slime and Trace
Date: 
Message-ID: <1148852144.125093.52050@i39g2000cwa.googlegroups.com>
Thank you very much for your information.

First I tried out CMUCL (which was very easy to install in emacs). But
CMUCL does not show the individual steps of recursive functions (using
"Trace") either, just like the "only-compile" OpenMCL.

Then I decided to go back to CLisp. But for me, it was a little bit
complicated to install. I didn't get it.

Does anybody know a link with hints for the installation with
Emacs/Slime under Mac OS X?
It should be a real no-brainer. ;-)

Thanks.
From: Texaner
Subject: Re: Slime and Trace
Date: 
Message-ID: <1148929841.576512.33940@i40g2000cwc.googlegroups.com>
Sorry, I have to correct my last (confusing) question!

Of course I am looking for a link with help concerning the installation
of CLisp under Mac OS X.

Thanks in advance.
From: Dr. John A.R. Williams
Subject: Re: Slime and Trace
Date: 
Message-ID: <87k686fvb9.fsf@mailhub.aston.ac.uk>
Is it possible that the compiler is tail-call optimising out the
recursive calls?

>>>>> "Texaner" == Texaner  <·········@web.de> writes:

    Texaner> Hello, I'm not very experienced with Slime/Emacs. Until
    Texaner> now I have used Lisp Box with CLisp. But the Lisp Boxes
    Texaner> use an old version of Slime and changed options in Emacs
    Texaner> cannot be saved.

    Texaner> So I tried to install a Slime/Emacs package on my own (on
    Texaner> Mac OS X) with the help of the following link:

    Texaner> http://blog.zenzoa.com/articles/search?q=installing


    Texaner> This link suggests to use OpenMCL so I tried a "new"
    Texaner> lisp.

    Texaner> The problem that I have now is that "Trace" does not work
    Texaner> properly.

    Texaner> If I use this feature the Tracer only prints the first
    Texaner> calling of my traced function and the last returen value
    Texaner> (of a recursive function).

    Texaner> I'm not able to inspect the callings and values of the
    Texaner> several steps in a recursive function as I could with my
    Texaner> Lisp Box-Installation. It printed: 1. Trace, 2. Trace and
    Texaner> so on.

    Texaner> So my question is: Is it a problem of my installation or
    Texaner> is it a problem of OpenMCL?

    Texaner> Thanks in advance for your answer.


-- 
John Williams 
PGP key: 6606795A185C384C
From: Thomas A. Russ
Subject: Re: Slime and Trace
Date: 
Message-ID: <ymislmrgzix.fsf@sevak.isi.edu>
"Texaner" <·········@web.de> writes:

> Hello,
> 
> This link suggests to use OpenMCL so I tried a "new" lisp.
> 
> The problem that I have now is that "Trace" does not work properly.
> 
> If I use this feature the Tracer only prints the first calling of my
> traced function and the last returen value (of a recursive function).
> 
> ...
> So my question is:
> Is it a problem of my installation or is it a problem of OpenMCL?

Actually it is a "feature" of OpenMCL.  The recursive calls are
optimized away by the compiler.  OpenMCL (and MCL) have only rudimentary
interpreters and use the compiler on any more advanced forms.

There are a couple of ways you can get around this.  One of them is to
tell the compiler to preserve the debugging information.  You can do
this by adding the following to your function definition:

  (declare (optimize (speed 0) (space 0) (debug 3)))

which should turn off the optimization and allow you to trace all of the
stack frames.  You could also do this globally by using DECLAIM instead.

Also, on some lisps (I can't recall offhand if OpenMCL is one of them),
if you re-evaluate or re-compile a traced function, then you will get
all of the trace information.  (In CLISP, you will lose all trace
information by doing this).



-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Texaner
Subject: Re: Slime and Trace
Date: 
Message-ID: <1149071251.900723.159290@i40g2000cwc.googlegroups.com>
Thomas A. Russ schrieb:

> "Texaner" <·········@web.de> writes:
>
> > Hello,
> >
> > This link suggests to use OpenMCL so I tried a "new" lisp.
> >
> > The problem that I have now is that "Trace" does not work properly.
> >
> > If I use this feature the Tracer only prints the first calling of my
> > traced function and the last returen value (of a recursive function).
> >
> > ...
> > So my question is:
> > Is it a problem of my installation or is it a problem of OpenMCL?
>
> Actually it is a "feature" of OpenMCL.  The recursive calls are
> optimized away by the compiler.  OpenMCL (and MCL) have only rudimentary
> interpreters and use the compiler on any more advanced forms.
>
> There are a couple of ways you can get around this.  One of them is to
> tell the compiler to preserve the debugging information.  You can do
> this by adding the following to your function definition:
>
>   (declare (optimize (speed 0) (space 0) (debug 3)))
>
> which should turn off the optimization and allow you to trace all of the
> stack frames.  You could also do this globally by using DECLAIM instead.
>
> Also, on some lisps (I can't recall offhand if OpenMCL is one of them),
> if you re-evaluate or re-compile a traced function, then you will get
> all of the trace information.  (In CLISP, you will lose all trace
> information by doing this).
>
>
>
> --
> Thomas A. Russ,  USC/Information Sciences Institute

Thanks.

The first suggestion works (with declaim and so on). The second
(re-evaluate) not.
I think this solution is sufficient for my purposes.

Although the CLisp-Trace was a little bit more comfortable. It showed
1. Trace, 2. Trace ... return value 2. Trace, return value 1. Trace
(with numbers!). With OpenMCL you receive only indentations and you
have to match the call and the return value with your eyes.