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

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

Passing optional arguments for use with internal functions


From: uzibalqa
Subject: Passing optional arguments for use with internal functions
Date: Thu, 27 Jul 2023 23:45:39 +0000

I have this function and want the ability to use the optional argument in
'lexif'.  I just added optional actm in reshuf so it is passed to 'lexif'
if the option is present.

Is this the way to allow optional arguments for 'lexif', or would I have 
additional tests to see whether 'actm' is present in 'reshuf' so that
I either call (lexif mutant) or (lexif mutant actm).

(defun reshuf (word n &optional actm)

  (let ( (wlis '()) )

    (add-to-list 'wlis word)
    (dotimes (i n)
      (let ((mutant (shuffle word)))

        (when (lexif mutant actm)
          (add-to-list 'wlis mutant) )))

    wlis))





reply via email to

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