Skip to content
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

Allow non-binding VARLIST entries in let* #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wtianyi
Copy link

@wtianyi wtianyi commented May 9, 2024

When VARLIST in let* is purely used for its side-effect and have no variable, do nothing.

For example, https://github.com/emacs-mirror/emacs/blob/73d2b829f06124fec8b65eebc68e87da48808086/lisp/comint.el#L3554

When VARLIST in `let*` is purely used for its side-effect and have no
variable, do nothing.
@Fuco1
Copy link
Member

Fuco1 commented May 9, 2024

The let and let* forms don't support such syntax. The code you linked is a when-let* macro which probably allows it to chain conditions, but in the expansion it's no longer without a variable binding.

Which means we can no longer alias when-let* to let*, because that would allow invalid let* forms to pass. Since the form is available, we could add a check on the let-flavour though, but it's a bit more work.

@wtianyi
Copy link
Author

wtianyi commented May 9, 2024

Ah thanks for the information! I should have looked at the syntax more closely. Not sure if I'll be able to, but if I have a more proper fix I'd push it here.

@wtianyi
Copy link
Author

wtianyi commented May 9, 2024

Actually I have some more questions: Currently elsa--analyse:let* breaks with an Invalid read syntax: "Expected form" error encountering a (VALUEFORM) entry (not binding anything) in the VARLIST. Do we want to give more informative lint in such case? How can that be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants