I think that jumping to source code from error message of compiler and interpretetor is very important feature.
I use slime with 'sbcl' and created the file 'test.l" with code:
(+ 1 2) (+ 3 "4")
The last line has an error
Next I do (in emacs)
M-x slime CL-USER>(load "test.l")
Course emacs teels me abou error. Then via debugging frame and commands 'M-n', 'M-p' or 'v' I can position to source code for the all frames. But no way to point at the 'test.l' file.
Why?
Or how i can from eror message jump to position of this error in a source code?
BTW. I checked also 'lisp' and 'clisp' - same result!
hww hww@inbox.ru writes:
Course emacs teels me abou error. Then via debugging frame and commands 'M-n', 'M-p' or 'v' I can position to source code for the all frames. But no way to point at the 'test.l' file.
Why?
Well, because you work in an unusual way and because your code has a very unusual bug.
Or how i can from eror message jump to position of this error in a source code?
Most people compile the source file and load the fasl file instead of the source file. If you load the source file, compiling, loading, and execution are interleaved and debugging becomes harder. So far, nobody has invested a lot of effort to make this situation easy to debug.
The usual (well, at least my) way to work is as follows:
1. write your code in a file 2. write definitions (not random code at toplevel) 3. compile a function with C-c C-c or an entire file with C-c C-k. 4. test little bits of code with C-x C-e or in the REPL
So I'd write your code like so:
(defun foo () (+ 1 2) (+ 3 "4"))
(foo)
Then type C-c C-c inside of foo and the compiler will say "Asserted type number conflicts with derived type ..." and M-n/M-p will bring you to the source form.
To test the function press C-x C-e after the (foo) line. In CMUCL, the backtrace looks like:
0: (kernel:two-arg-+ 3 "4") 1: (+ 3 "4") 2: ("defslimefun interactive-eval")
Pressing v on frame 1 and will bring you the source in the file numbers.lisp. Unfortunately, tailcall optimization has removed the frame for foo. If you suppress tailcall optimization, e.g., with (declaim (optimize (debug 3))), the backtrace will have a frame for foo an v should bring you to the source.
The v command doesn't work so well in SBCL because no one has implemented compile-from-stream yet and only minimal debug info is generated with the default compiler settings. Please file a bug report to the SBCL developers about this issue :)
When compiling with C-c C-k, CMUCL removes the code entirely. Dunno why; perhaps a bug or maybe because + doesn't have side effects.
In general, you have to know a little about what kind of debugging works best with your implementation and tell the compiler to emit debugging info. Most debugging features in SLIME are biased towards CMUCL, because, well, nobody did the polishing for the other implementations.
Helmut.
Helmut Eller wrote:
Well, because you work in an unusual way and because your code has a very unusual bug.
Most people compile the source file and load the fasl file instead of the source file. If you load the source file, compiling, loading, and execution are interleaved and debugging becomes harder. So far, nobody has invested a lot of effort to make this situation easy to debug.
I got the point.
Well. The SLIME is not what i need. I am searching a simple interactive IDE which can be compared with VisualBasic (without GUI design). Just interpretetor, compiler, changing source on the fly, jumping frome error to source, and etc. I see that Slime is not. It is more like VC's editor.
Thanks anyway
BTW. I check another project JABBERWOCKLY, it is mauch better. But maden with Java and works slowly. Also many bugs.
Maybe sombody know about a good Lisp (Scheme) IDE similar LispWorks or Allegro?
On Fri, 18 Mar 2005 00:00:26 +0200, hww hww@inbox.ru wrote:
I got the point.
Judging from what you write below you haven't.
Well. The SLIME is not what i need. I am searching a simple interactive IDE which can be compared with VisualBasic (without GUI design). Just interpretetor, compiler, changing source on the fly, jumping frome error to source, and etc. I see that Slime is not. It is more like VC's editor.
Thanks anyway
BTW. I check another project JABBERWOCKLY, it is mauch better. But maden with Java and works slowly. Also many bugs.
Maybe sombody know about a good Lisp (Scheme) IDE similar LispWorks or Allegro?
Edi.
Edi Weitz wrote:
I got the point.
Judging from what you write below you haven't.
Why? Why you thing so? :)
Actualy I can answer you same. You did not get my point well. Think about. :)
I understand that SLIME is IDE, maybe powerfull IDE. Maybe beautifull.
But this kind of IDE is not useful for me.
I am sure that You are civil. You have a fan with SLIME. You enjoy with SLIME. You can create everything what you want with Lisp.. Emacs and SLIME.
But I am not. I am pure and stupid. And what?
Yes I am not so smart. But smart enought to recognize that SLIME is not an Easy To Use IDE.
- write definitions (not random code at toplevel)
This is bad. What is the problem with file without definition? Does Lisp language not support it? If does - then IDE should let it too.
Maybe there it 10 things why SLIME does not...
But this is 10 things why SLIME is not what I need.
Look at this http://www.sketchup.com/. So many feature, exelent tool. But it is easy to use also. Very simple. Very creativity. Very usable.
- compile a function with C-c C-c or an entire file with C-c C-k.
First thing, I do not like a long sequences like C-C C-k and etc. For me this is bad side of EMACS. I will hope that sombody will improve it for stupid people like me. Hope I am not single. ;)
Second I think the VB's IDE has very simple interface.
F5 start program. C-F5 start with full compile S-F5 continue C-Break Break ---------------------- F8 step into S-F8 step over C-S-F8 step out C-F8 run to cursor ---------------------- F9 togle break point C-S-F9 clear all breackpoints
etc.
On error - it point cursor to error line automaticly. I can change source and continue programm by F5. (In some cases it can't continue)
I like it. It is very simpe.
Yes, maybe it has no many cool things but for me it is enought. And I do not see any reason to make this features more complicated.
What is reason to change start from F5 to M-x M-s for example?
PS. This is my job to make the job our team and my, more simple, more comfortable. Even artist should use this IDE, but not only programmers.
Do you think that to make an easy to use IDE for Lisp (scheme) impossible? Maybe you think that nobody need it?
I think this is first problem of Lisp world, there is no good, cheap, simple and modern IDE.
And if Lispers realy smart, and I sure that Lisp programmer is somthing special, most powerfull programmer. Ok. If it like I said they should create this IDE. It help to Lisp world so much.
Look around. Amiga's people so much love Amiga and made cool things like AROS http://www.aros.org/
Where is Lispers?
Do you realy think that I am do not understand you friend? :)
-- hww - - Hard Ware Woman
On Fri, 18 Mar 2005 04:27:00 +0200, hww hww@inbox.ru wrote:
This is bad. What is the problem with file without definition?
A file without function definitions is not a program, that's very simple.
Second I think the VB's IDE has very simple interface.
F5 start program.
Even if you have a file without definitions? Cool stuff, this VB.
Edi.
Edi Weitz writes:
On Fri, 18 Mar 2005 04:27:00 +0200, hww hww@inbox.ru wrote:
This is bad. What is the problem with file without definition?
A file without function definitions is not a program, that's very simple.
Well, kind of. The toplevel is good for interactively poking at things, but it can also be nice to do that in a buffer. Using Squeak Smalltalk a few years ago, I got the habit of testing things that way. I still do that because then I have a record of what I did to test my program, and I can later pare it down into a test suite much more easily than writing one from scratch. C-M-x is kind of half-way between do-it and print-it, so it works well enough. I real print-it like in Squeak would be cool, but I don't think it would really add anything substantial over what Slime has now (besides just more newbie-awing cool-factor).
That said, I don't get hww's question. If you have a buffer full of disembodied forms you want to evaluate, point to them and say "eval this", aka C-M-x. Don't just write scripts. If you do things that way, it has the advantage that you *know* where the error was, you're pointing at it.
Thomas F. Burdick wrote:
Edi Weitz writes:
On Fri, 18 Mar 2005 04:27:00 +0200, hww hww@inbox.ru wrote:
This is bad. What is the problem with file without definition?
A file without function definitions is not a program, that's very simple.
Well, kind of. The toplevel is good for interactively poking at things, but it can also be nice to do that in a buffer.
Absolutely true! This is similar MEL in Maya. Just make sequense execute it. Then it can be used as source. Some kind of interactivity.
That said, I don't get hww's question. If you have a buffer full of disembodied forms you want to evaluate, point to them and say "eval this", aka C-M-x. Don't just write scripts. If you do things that way, it has the advantage that you *know* where the error was, you're pointing at it.
So My friend shown me that the problem was that C-c C-c does not shows error message when I did it first time in session. After fisrt C-c C-c (for nothing) all begin works OK And all another C-c C-c shows error message, and underline all errors.
I got that while compiler shows error, it does not create somthing. And that is why when I start function and it shows error I can't jump from (foo) frame.
But, this is not problem cause compiler should show message and error should be corrected.
My friend show me another example
(defun foo(a) (/ 2 a) )
(foo 0)
Which compiled without errors but still has this error. And when program breaks here. 'v' (even as M-p/M-n) from frame (foo 0) jumps to source wery well. :)
I can claim that SLIME works (with some but) but I can't be aggree friends, that SLIME+EMACS is easy to use IDE. Sorry. :)
But I can be aggree that it is besta what I saw for Lisp.
Well
I receive private mesage and red here that my messages to this forum seems too aggressive for unless one person.
I want to be correct with all people who red my messages. I was not aggressive, and did not want to make bad to some body.
I really thing that all Lisp-programmers are great and very smart. It was not joke or insult joke. It is what I think about Lispers.
I want to see in a world a low cost, easy to use, Lisp IDE. This is what I dream about.
I see that I came to wrong pace or to wrong time. Or I just sad something bad.
I want claim that If you thought that I am unfriendly that You just did not understand me.
I please sorry everybody who feel bad about my messages. I am very sad about.
Sorry again, Thank you for great help, Best regards hww
Edi Weitz wrote:
On Fri, 18 Mar 2005 04:27:00 +0200, hww hww@inbox.ru wrote:
This is bad. What is the problem with file without definition?
A file without function definitions is not a program, that's very simple.
Why? The specification of Lisp does not describe about. (defun () (+1 2) )
(foo)
In finish there was (foo) it was not defined as another function. What is the problem about to have
(foo) (bar)
And what is the problem if both of them implemented in different file? In result the file without definitions.
Helmut Eller wrote:
So I'd write your code like so:
(defun foo () (+ 1 2) (+ 3 "4"))
(foo)
Then type C-c C-c inside of foo and the compiler will say "Asserted type number conflicts with derived type ..." and M-n/M-p will bring you to the source form.
Well. Some more deatils. There is two place with 'foo' first in defun second '(foo)'
If i will make first C-c C-c in defun place. It says not what you said. It says 'Loading cl-extra...done'
If i will make first C-c C-c in (foo) place. It says not what you said also. It says 'The functionFOO is undefined'
If i will make C-c C-c C-c C-c in defun place. It says not what you said too. It says 'Compilation finished: 0 errors 1 warning 1 note [0.32 secs]'
But If I will make first C-c C-c in defun place then C-c C-c in (foo) place. It says right, more similar what you say.
'The value "3" is not of type NUMBER. [Condition of type TYPE-ERROR]'
WOW! I got it! ;)
As you said 'v' does not work. But it is OK. We have M-n/M-p .... Wait a minute... ;) It show sources for all frames but not for frame (FOO) !!!
No way to jump ... :/
Ok. Ok. I am stupid. I can't use it correctly. And you know what?
I agree Yes I can't :)
Sorry guys EMACS+SLIME+SBCL is too smart IDE for me.