Skip to content

Fix style warning about unknown :FORCE keyword arg to close-channel#697

Merged
joaotavora merged 1 commit intojoaotavora:masterfrom
aartaka:fix-force-key-style-warning
Dec 12, 2025
Merged

Fix style warning about unknown :FORCE keyword arg to close-channel#697
joaotavora merged 1 commit intojoaotavora:masterfrom
aartaka:fix-force-key-style-warning

Conversation

@aartaka
Copy link
Copy Markdown
Contributor

@aartaka aartaka commented Dec 9, 2025

Hi!

Just now, loading Slynk, I got this warning:

; in: DEFUN SLYNK::CLOSE-CONNECTION%
;     (SLYNK::CLOSE-CHANNEL SLYNK::C :FORCE T)
; 
; caught STYLE-WARNING:
;   :FORCE is not a known argument keyword.

The problem was with the initial slynk::close-channel definition (a defmethod in slynk/slynk.lisp) not allowing additional keyword arguments, with slynk::close-connection providing a previously unknown argument. So I went ahead and fixed arglists with an &allow-other-keys

@aadcg
Copy link
Copy Markdown
Collaborator

aadcg commented Dec 11, 2025

Looks good to me, but please write commits as detailed at https://github.com/joaotavora/sly/?tab=contributing-ov-file#commit-messages.

@joaotavora kindly asked me follow that guideline.

@aartaka aartaka force-pushed the fix-force-key-style-warning branch 2 times, most recently from f1e15ea to 4da729c Compare December 11, 2025 21:37
@aartaka
Copy link
Copy Markdown
Contributor Author

aartaka commented Dec 11, 2025 via email

@joaotavora
Copy link
Copy Markdown
Owner

I think the right thing to do here is to declare the keyword argument force and ignore it.

@aartaka
Copy link
Copy Markdown
Contributor Author

aartaka commented Dec 11, 2025 via email

* slynk/slynk.lisp (close-channel): Introduce a :FORCE argument
@aartaka aartaka force-pushed the fix-force-key-style-warning branch from 4da729c to f004887 Compare December 11, 2025 23:45
@joaotavora joaotavora merged commit b01993c into joaotavora:master Dec 12, 2025
17 checks passed
@joaotavora
Copy link
Copy Markdown
Owner

The CLHS has rules about the meaning of &key in a generic function. IIRC (but it was a long time ago since I looked it up), a &key in the defgeneric or in one of the methods of the generic meant all of them were &allow_other_keys. Or at least this is the way the implementation I used at the time worked since I don't remember it complaining. Anyway this would match what you wanted to do. But &allow-other-keys in general is a code smell, so if we're going to change it, might as well dtrt.

@aartaka
Copy link
Copy Markdown
Contributor Author

aartaka commented Dec 12, 2025 via email

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.

3 participants