all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* List Argument followed by &rest
@ 2024-12-08  0:12 Heime via Users list for the GNU Emacs text editor
  2024-12-12 11:09 ` Joel Reicher
  0 siblings, 1 reply; 2+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2024-12-08  0:12 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


Consider the following function with an argument and with 
&rest.

The first argument is a list (if single element is provided, 
it is converted to a list).  

Thus I can write 

   (medha-kntlr 'armg basic substring) 

and 

   (medha-kntlr '(armg go) basic substring)

And styles can also be considered as a list of arguments, am I right?
Is this how it works?

(defun medha-kntlr (seqr &rest styles)

  (let ( (seqr  (if (listp seqr) seqr (list seqr))) )

    (dolist (actm actm-seqr)
      (pcase actm

        ('armg  (dolist (style styles)
                  (message "Style: %s" style)))

        ('go    (setq completion-styles styles))

        (_      (message "Invalid Argument")) ))))





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-12 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-08  0:12 List Argument followed by &rest Heime via Users list for the GNU Emacs text editor
2024-12-12 11:09 ` Joel Reicher

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.