Skip to content

Conversation

mrhmouse
Copy link

@mrhmouse mrhmouse commented Oct 1, 2025

By quoting these symbols, we're actually matching against either the symbol being quoted (e.g. getStatuses) or against the symbol quote

cl-case does produce warnings for this when jiralib.el is compiled

By quoting these symbols, we're actually matching against
either the symbol being quoted (e.g. `getStatuses`) or
against the symbol `quote`

cl-case does produce warnings for this when jiralib.el is compiled
@ahungry
Copy link
Owner

ahungry commented Oct 4, 2025

Awesome catch, thank you.

I'm curious, what benefit does the extra paren set around the keyword serve? (let's pretend I'm still getting my coffee injection to wake up and fully turn on my brain 🤣 )

(setq mymethod "getIssue")

;; "Issue"
(cl-case (intern mymethod)
  ('getIssue (print "Issue"))
  ('getComments (print "Comments")))

;; "Issue"
(cl-case (intern mymethod)
  ((getIssue) (print "Issue"))
  ((getComments) (print "Comments")))

;; "Issue"
(cl-case (intern mymethod)
  (getIssue (print "Issue"))
  (getComments (print "Comments")))

(setq notmymethod "quote")

;; "Issue"
(cl-case (intern notmymethod)
  ('getIssue (print "Issue"))
  ('getComments (print "Comments")))

;; nil
(cl-case (intern notmymethod)
  ((getIssue) (print "Issue"))
  ((getComments) (print "Comments")))

;; nil
(cl-case (intern notmymethod)
  (getIssue (print "Issue"))
  (getComments (print "Comments")))

I see your change will fix the compilation error (nice!) and the logic error where we could have dispatched to the first clause if someone passed in the literal word "quote" - but is the bottom option without the extra parens sufficient?

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