-
-
Notifications
You must be signed in to change notification settings - Fork 29
Add error check for creating a MENU with empty ITEMS. #2307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There might be cases where a MENU is constructed incrementally, starting with an empty ITEMS list. This change will break that situation! (My first thought was to default the ITEMS to (LIST "*** Empty MENU!! ***"). That felt like a hack solution.)
|
When building Medley on Linux Mint 22.1 Cinnamon I get this error:
This is the directory loadups/build: build.zip |
masinter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
building incrementally and starting with a invalid structure until built is a common usage pattern and should be accomodated.
(create MENU) should return. It MIGHT be better to avoid the divide-by-zero error, BUT I don't think that makes anything more stable or fixes any problems with backward compatibility or portability. The manual doesn't say what (MENU (craete MENU)) does, but it doesn't say what (MENU (create MENU ITEMS _
'JUNK)) does either.
|
Closing this PR as the strategy is wrong. |
|
My concern is that a divide-by-zero from deep in the menu code does not help a user figure out what's wrong. An error with a meaningful message that happens later, when the menu is actuallly displayed would be OK. But it might be harder to trap those situations.
… On Oct 2, 2025, at 11:11 AM, Matt Heffron ***@***.***> wrote:
MattHeffron
left a comment
(Interlisp/medley#2307)
<#2307 (comment)>
Closing this PR as the strategy is wrong.
—
Reply to this email directly, view it on GitHub <#2307 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AQSTUJOGUXKNZATNEAE3TSL3VVTGTAVCNFSM6AAAAACICKJCMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNRSGQYTCOJVHA>.
You are receiving this because your review was requested.
|
That was going to be my next approach. |

This addresses issue #2306.
There might be cases where a
MENUis constructed incrementally, starting with an emptyITEMSlist. This change will break that situation!(My first thought was to default the
ITEMSto(LIST "*** Empty MENU!! ***"). That felt like a hack solution.)