Lisp HUG Maillist Archive

LispWorks REPL Errors

Hello All,

 

Please pardon my newbie terminology. Is there a way to disable the debugger in the LispWorks listener. I would like it to just print the error while staying in the top level? I find it very distracting when trying things out.

 

Thanks,

Gerry

 

Re: LispWorks REPL Errors

Gerry Weaver <gerryw@compvia.com> writes:

> Please pardon my newbie terminology. Is there a way to disable the
> debugger in the LispWorks listener. I would like it to just print the
> error while staying in the top level? I find it very distracting when
> trying things out.

You can easily write your own REPL:

http://www.cliki.net/repl

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: LispWorks REPL Errors

Gerry,

While I can certainly understand where you are coming from, I hope you don't mind a little nudge to suggest "don't do that." ;)

Your other posts have been relaying how you are still learning lisp and LW currently. Debugging Lisp is very different (IMO) that debugging traditional C++ code. And it's much better. Instead of trying to disable the debugger - even for simple things - take a moment to look at it, the restarts, the backtrace, etc.

If you are using the LW IDE you can just click the toolbar button for "Abort" which will return you to the top level. Also, it's probably good to practice getting yourself in a mindset where working from within the debugger doesn't bother you. Hit a problem? Keep working until it's solved, then either continue or abort back to the top level.

If you have any experience with Smalltalk, you can think of it like that. If you haven't, you really should take the time to get used to using it with your practice code, explore, and play around. 

This is especially true with condition handlers and restarts. Learn to make and use them. This will be one of those "holy shit!" (please excuse the explicative) moments... Like learning closures for the first time. :)

Jeff M.

On Feb 17, 2013, at 3:59 PM, Gerry Weaver <gerryw@compvia.com> wrote:

Hello All,

 

Please pardon my newbie terminology. Is there a way to disable the debugger in the LispWorks listener. I would like it to just print the error while staying in the top level? I find it very distracting when trying things out.

 

Thanks,

Gerry

 

RE: LispWorks REPL Errors

Hi Jeffrey,

 

I don’t mind “a little nudge” at all. I think your recommendation makes perfect sense. I guess I am so used to the C/C++ world that I failed to consider the differences between the languages. In C/C++ I only use a debugger to get the call stack trace before a segfault. Otherwise, I never use one at all. Lisp on the other hand is a different animal.  I should slow down and try harder not to let old habits get the better of me. I have also noticed that there is a fair amount of Lisp code out there that doesn’t do any error handling at all. I already have a big bold item on my todo list for getting comfortable with Lisp error handling. It all needs to be done and that would be a much better way to approach it. Thanks for the nudge ;-)

 

Thanks,

Gerry

 

 

 

From: Jeffrey Massung [mailto:massung@gmail.com]
Sent: Sunday, February 17, 2013 4:44 PM
To: Gerry Weaver
Cc: lisp-hug@lispworks.com
Subject: Re: LispWorks REPL Errors

 

Gerry,

 

While I can certainly understand where you are coming from, I hope you don't mind a little nudge to suggest "don't do that." ;)

 

Your other posts have been relaying how you are still learning lisp and LW currently. Debugging Lisp is very different (IMO) that debugging traditional C++ code. And it's much better. Instead of trying to disable the debugger - even for simple things - take a moment to look at it, the restarts, the backtrace, etc.

 

If you are using the LW IDE you can just click the toolbar button for "Abort" which will return you to the top level. Also, it's probably good to practice getting yourself in a mindset where working from within the debugger doesn't bother you. Hit a problem? Keep working until it's solved, then either continue or abort back to the top level.

 

If you have any experience with Smalltalk, you can think of it like that. If you haven't, you really should take the time to get used to using it with your practice code, explore, and play around. 

 

This is especially true with condition handlers and restarts. Learn to make and use them. This will be one of those "holy shit!" (please excuse the explicative) moments... Like learning closures for the first time. :)

 

Jeff M.


On Feb 17, 2013, at 3:59 PM, Gerry Weaver <gerryw@compvia.com> wrote:

Hello All,

 

Please pardon my newbie terminology. Is there a way to disable the debugger in the LispWorks listener. I would like it to just print the error while staying in the top level? I find it very distracting when trying things out.

 

Thanks,

Gerry

 

RE: LispWorks REPL Errors

Hi Jeffrey,

 

Sorry. I missed your Smalltalk reference. I actually looked at Smalltalk (VisualWorks) quite a bit in my quest for a C++ replacement. I really liked it at first, but when I tried to actually do something more than just playing around, I realized very quickly that it wasn’t right for me. However, Smalltalk did teach me one very important and unexpected lesson. Pure object oriented languages are not the answer. Another thing that I found extremely difficult was the way you write the code. Everything in the Smalltalk environment is an object except your view of the code. The code editor is method oriented. I could never get past that and I did try. It was a lot like trying to create a painting while only being able to see an area the size of a quarter. I have come to refer to Smalltalk programming as “keyhole” programming ;-). I know there are a lot of people who think it is awesome, but it just wasn’t right for me. However, I do get your reference.

 

BTW: If I had not chosen Lisp, I would probably have gone with OCaml.

 

Thanks,

Gerry

 

 

From: Jeffrey Massung [mailto:massung@gmail.com]
Sent: Sunday, February 17, 2013 4:44 PM
To: Gerry Weaver
Cc: lisp-hug@lispworks.com
Subject: Re: LispWorks REPL Errors

 

Gerry,

 

While I can certainly understand where you are coming from, I hope you don't mind a little nudge to suggest "don't do that." ;)

 

Your other posts have been relaying how you are still learning lisp and LW currently. Debugging Lisp is very different (IMO) that debugging traditional C++ code. And it's much better. Instead of trying to disable the debugger - even for simple things - take a moment to look at it, the restarts, the backtrace, etc.

 

If you are using the LW IDE you can just click the toolbar button for "Abort" which will return you to the top level. Also, it's probably good to practice getting yourself in a mindset where working from within the debugger doesn't bother you. Hit a problem? Keep working until it's solved, then either continue or abort back to the top level.

 

If you have any experience with Smalltalk, you can think of it like that. If you haven't, you really should take the time to get used to using it with your practice code, explore, and play around. 

 

This is especially true with condition handlers and restarts. Learn to make and use them. This will be one of those "holy shit!" (please excuse the explicative) moments... Like learning closures for the first time. :)

 

Jeff M.


On Feb 17, 2013, at 3:59 PM, Gerry Weaver <gerryw@compvia.com> wrote:

Hello All,

 

Please pardon my newbie terminology. Is there a way to disable the debugger in the LispWorks listener. I would like it to just print the error while staying in the top level? I find it very distracting when trying things out.

 

Thanks,

Gerry

 

RE: LispWorks REPL Errors

Hi Mikel,

That is actually pretty darn cool! I am going to make an attempt to do exactly what you are describing as "just-in time programming". It just sounds like good clean fun ;-)

Thanks,
Gerry


-----Original Message-----
From: mikel evins [mailto:mevins@clozure.com] 
Sent: Sunday, February 17, 2013 5:25 PM
To: Gerry Weaver
Cc: mikel evins; Jeffrey Massung; lisp-hug@lispworks.com
Subject: Re: LispWorks REPL Errors


On Feb 17, 2013, at 5:06 PM, Gerry Weaver <gerryw@compvia.com> wrote:

> Hi Jeffrey,
>  
> I don't mind "a little nudge" at all. I think your recommendation makes perfect sense. I guess I am so used to the C/C++ world that I failed to consider the differences between the languages. In C/C++ I only use a debugger to get the call stack trace before a segfault. Otherwise, I never use one at all. Lisp on the other hand is a different animal.  I should slow down and try harder not to let old habits get the better of me. I have also noticed that there is a fair amount of Lisp code out there that doesn't do any error handling at all. I already have a big bold item on my todo list for getting comfortable with Lisp error handling. It all needs to be done and that would be a much better way to approach it. Thanks for the nudge ;-)

There's a different style of debugging to learn. There's nothing wrong with looking at stack traces, or with printf debugging, and you still have those available to you in Lisp. However, you have some additional tools in Lisp that are pretty handy, and that you're unlikely to be aware of if you haven't used a language that provides them, like Lisp or Smalltalk.

The REPL stops in a break loop so that you can examine the live stack--not the way you would examine a C stack trace, where the computation is over and the stack trace is a fossil record, but while the computation is still live and pending. In a break loop you can look at the state of the live machine, paused between instructions. You can look and see if the values in the lexically-visible variables are what you expect them to be. If they're not, you can interactively change them and resume the computation, to confirm whether fixing the difference ends in correct results. You can even redefine offending functions and then restart.

These facilities make a whole different style of programming available. You can write just the top-level entry point and run it. Of course, it's going to break, but when you land in the break loop you can write the next functions you need and resume. When you hit another break loop, you can write the next functions, and so on. It's kind of a logical extreme of test-driven development--where you really having nothng when you start but the notion of what goals you want the program to satisfy. It's just-in-time programming--not, maybe, the way you want to work all the time, but a handy option to have. It offers the opportunity to follow a thought all the way to its logical conclusion with live code, while all the context is fresh in your mind.



_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: LispWorks REPL Errors

Hi,

it makes sense to keep the debugger. One thing you get there are Restarts. The better the Lisp environment is, the more and the more useful Restarts it is offering.

You can also get out of the Debugger by typing :top . Check out the various commands. It allows you for example to locate the source code of the function which caused the error. It might even be useful to set the system option to bring up a real debugger window, always.

The whole debugging facilities in LispWorks are extremely powerful. Makes sense to learn it piece by piece.

But you even can get Lisp to ignore the whole debugger.


CL-USER 30 > (defun my-debugger (condition hook)
               (declare (ignore hook))
               (princ condition)
               (abort condition))
MY-DEBUGGER

CL-USER 31 > (setf *debugger-hook* 'my-debugger)
MY-DEBUGGER

CL-USER 32 > (/ 3 0)
Division-by-zero caused by / of (3 0).

CL-USER 33 > 

See the documentation of *DEBUGGER-HOOK*. Put the text cursor in LispWorks on the symbol and press control-shift-d.

Setting the debugger hook to NIL gets back to normal...

Regards,

Rainer Joswig



Am 17.02.2013 um 22:59 schrieb Gerry Weaver <gerryw@compvia.com>:

Hello All,
 
Please pardon my newbie terminology. Is there a way to disable the debugger in the LispWorks listener. I would like it to just print the error while staying in the top level? I find it very distracting when trying things out.
 
Thanks,
Gerry
 

RE: LispWorks REPL Errors

Hi Rainer,

 

This will be handy to have. I’m pretty sure that even after I learn how to use the debugger, there may be times when I just don’t want it on. It looks like I can just create a couple functions in my initialization file that will allow me to turn it on and off easily. I appreciate the example!

 

Thanks,

Gerry

 

 

From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Rainer Joswig
Sent: Monday, February 18, 2013 3:24 AM
To: lisp-hug@lispworks.com
Subject: Re: LispWorks REPL Errors

 

Hi,

 

it makes sense to keep the debugger. One thing you get there are Restarts. The better the Lisp environment is, the more and the more useful Restarts it is offering.

 

You can also get out of the Debugger by typing :top .. Check out the various commands. It allows you for example to locate the source code of the function which caused the error. It might even be useful to set the system option to bring up a real debugger window, always.

 

The whole debugging facilities in LispWorks are extremely powerful. Makes sense to learn it piece by piece.

 

But you even can get Lisp to ignore the whole debugger.

 

 

CL-USER 30 > (defun my-debugger (condition hook)

               (declare (ignore hook))

               (princ condition)

               (abort condition))

MY-DEBUGGER

 

CL-USER 31 > (setf *debugger-hook* 'my-debugger)

MY-DEBUGGER

 

CL-USER 32 > (/ 3 0)

Division-by-zero caused by / of (3 0).

 

CL-USER 33 > 

 

See the documentation of *DEBUGGER-HOOK*. Put the text cursor in LispWorks on the symbol and press control-shift-d.

 

Setting the debugger hook to NIL gets back to normal....

 

Regards,

 

Rainer Joswig

 

 

 

Am 17.02.2013 um 22:59 schrieb Gerry Weaver <gerryw@compvia.com>:



Hello All,

 

Please pardon my newbie terminology. Is there a way to disable the debugger in the LispWorks listener. I would like it to just print the error while staying in the top level? I find it very distracting when trying things out.

 

Thanks,

Gerry

 

 

Re: LispWorks REPL Errors

Gerry Weaver <gerryw@compvia.com> writes:

> Sorry. I missed your Smalltalk reference. I actually looked at
> Smalltalk (VisualWorks) quite a bit in my quest for a C++
> replacement. I really liked it at first, but when I tried to actually
> do something more than just playing around, I realized very quickly
> that it wasn’t right for me. However, Smalltalk did teach me one very
> important and unexpected lesson. Pure object oriented languages are
> not the answer. Another thing that I found extremely difficult was
> the way you write the code. Everything in the Smalltalk environment
> is an object except your view of the code. The code editor is method
> oriented. I could never get past that and I did try. It was a lot
> like trying to create a painting while only being able to see an area
> the size of a quarter. I have come to refer to Smalltalk programming
> as “keyhole” programming ;-). I know there are a lot of people who
> think it is awesome, but it just wasn’t right for me. However, I do
> get your reference.

The "object" view is somehow restored with the browser, where you can
see the classes and the categories.  When you select a class, you get
the list of methods on that class.

But indeed, the classic smalltalk browser is rather limited in this view
(I suppose systems written with the classic tools weren't too big so it
wasn't a problem).  Nowdays, OO systems are built that are so big we
indeed need better browsers.

But this is true across all programming languages.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


RE: LispWorks REPL Errors

Hi Pascal,

I think I may have been too harsh with my previous comments. Yes. I think Smalltalk could use a little updating. I also think a more conventional code editor would make it more accessible. I have actually had several good conversations with Arden Thomas at Cincom/VisualWorks about this very thing. The folks on the VisualWorks team are awesome by the way. They seem to be very interested in bringing Smalltalk to a wider audience. I found the language itself to be quite elegant. However, I think a large project would get out of hand pretty quickly. This was my main issue with it. I found that I also have certain reservations about the "everything is an object" approach.  I guess I would need to get a reasonably good sized project done to see that at scale. I do still maintain my subscription though. I think it is entirely possible that they could come up with something that would change my mind. I know they are working hard on various enhancements. I hope my comments don't prevent anyone from taking a look at it. It never hurts to have multiple power tools in the programming toolbox :)

Thanks,
Gerry


-----Original Message-----
From: owner-lisp-hug@lispworks.com [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Pascal J. Bourguignon
Sent: Monday, February 18, 2013 12:54 PM
To: lisp-hug@lispworks.com
Subject: Re: LispWorks REPL Errors


Gerry Weaver <gerryw@compvia.com> writes:

> Sorry. I missed your Smalltalk reference. I actually looked at 
> Smalltalk (VisualWorks) quite a bit in my quest for a C++ replacement. 
> I really liked it at first, but when I tried to actually do something 
> more than just playing around, I realized very quickly that it wasn’t 
> right for me. However, Smalltalk did teach me one very important and 
> unexpected lesson. Pure object oriented languages are not the answer. 
> Another thing that I found extremely difficult was the way you write 
> the code. Everything in the Smalltalk environment is an object except 
> your view of the code. The code editor is method oriented. I could 
> never get past that and I did try. It was a lot like trying to create 
> a painting while only being able to see an area the size of a quarter. 
> I have come to refer to Smalltalk programming as “keyhole” programming 
> ;-). I know there are a lot of people who think it is awesome, but it 
> just wasn’t right for me. However, I do get your reference.

The "object" view is somehow restored with the browser, where you can see the classes and the categories.  When you select a class, you get the list of methods on that class.

But indeed, the classic smalltalk browser is rather limited in this view (I suppose systems written with the classic tools weren't too big so it wasn't a problem).  Nowdays, OO systems are built that are so big we indeed need better browsers.

But this is true across all programming languages.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.

_______________________________________________
Lisp Hug - the mailing list for LispWorks users lisp-hug@lispworks.com http://www.lispworks.com/support/lisp-hug.html


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


(LispWorks Hug) CAPI Pane Update Question...

Greetings to the List -

One thing that I have noticed over the past couple of years building 
CAPI code is that quite often when I am struggling to get CAPI to 
make updates to a pane, that if I insert a series of 
(capi:display-message xx) in the code after each pane operation, that 
I see the individual updates - but, if I do not, then I see no 
updates at all -- which usually indicates that I am using the wrong 
thread or something equally silly.

However, if I insert (instead of the capi:display-message):

                (mp:process-wait-with-timeout   "Waiting for 
Godot..."   0.01)  ; ...which, of course, returns in any event after 
a centisecond...

which I would think is equivalent, in the sense of allowing an update 
to run, to the capi:display-message, then I see no such pane updates 
on the screen.


Question:      Why 
would     capi:display-message     and 
mp:process-wait-with-timeout     effect pane updates differently with 
all else being equal?  Both calls, I assume, allow timeslicing to 
similarly happen etc.

....all in LW 5.x...

Thoughts??


Regards,

Jack Harper
Secure Outcomes Inc
Evergreen, Colorado USA


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:35 UTC