Replies: 5 comments 2 replies
|
I think that would be a good policy going forward. But for legacy issues it would require figuring out exactly where and why an error is being generated in code that we don't understand and are not really interestinged in devling into. If we don't really care why it fails and we just want it to go away, an NLSETQ is better than nothing. |
|
I think SEDIT:GET-SELECTION was rewritten without thinking about whether there was always a selection. This is how it used to read (years and years ago): Someone introduced at So I definitely would NOT just wrap an NLSETQ around the caller -- it was supposed to return NIL, but someone broke it. |
|
On 16 Jun 2026, at 02:02, Larry Masinter ***@***.***> wrote:
This is, in Common Lisp terms, a CATCH of all errors. It doesn't distinguish error types at all. Medley has the Common Lisp condition system now integrated. It would be better to catch errors that are actually anticipated. NLSETQ will catch a control-E keystroke, or a storage full error, or errors that are really from some other cause.
One thing you could do (given the CL condition system) would be to temporarily replace code that uses NLSETQ by a macro which behaves the same, except it establishesa handler for ERROR conditions (or the appropriate type) which loggs them somewhere but then simply returns NIL the way NLSETQ does. You'd want to use HANDLER-BIND so you can know where the thing happens better. That would provide some visibility into what nasties NLSETQ is hiding from you.
…--tim
|
|
Meanwhile -- let's take OUT the NLSETQ in the CLIPBOARD code around the call to SEDIT:GET-SELECTION, and fix the bogus code that was introduced into SEDIT:GET-SELECTION that attempts to fetch fields from an object that may be NIL. SEDIT:GET-SELECTION is not supposed to error, it's supposed to return |
|
General issue #2668 opened ... |
Uh oh!
There was an error while loading. Please reload this page.
NLSETQ is an Interlisp function which is used to "hide" errors of any sort. (NLSETQ (dosomething))
is defined to evaluate (dosomething) and, if there's an error,return NIL; if there's an error of any sort at all, it returns (LIST dosomethingvalue). Usage is simple if you're executing and want to insure here is no error: call (CAR (NLSETQ (dosomething))).
This is, in Common Lisp terms, a CATCH of all errors. It doesn't distinguish error types at all. Medley has the Common Lisp condition system now integrated. It would be better to catch errors that are actually anticipated. NLSETQ will catch a control-E keystroke, or a storage full error, or errors that are really from some other cause.
I don't propose systematically trying to redefine all the calls to NLSETQ, but it's worth the trouble to try to avoid adding NEW calls to NLSETQ.
(More about NLSETQGAG and the use of NLSETQ to hide errors in HCFILES or adding initially when importing something which has too many errors to track down them all, but eventually get rid of it.
All reactions