help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

List Argument followed by &rest


From: Heime
Subject: List Argument followed by &rest
Date: Sun, 08 Dec 2024 00:12:14 +0000

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")) ))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]