all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Computations on indices
@ 2023-07-28 19:07 Heime
  0 siblings, 0 replies; only message in thread
From: Heime @ 2023-07-28 19:07 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

How can I use 'k-1' in the following function ?

(defun permutor (k word)
  "Generate all permutations of WORD."

  (let ( (wlis '())
         ;; (c (make-vector n 0))
         (i 0) )

    (if (<= k 1)

        (add-to-list 'wlis word)

      (while (< i k)
        (permutor k-1 word)

        (if (evenp i)
            (add-to-list 'wlis (protilus-cswap word i k-1))
          (add-to-list 'wlis (protilus-cswap word 0 k-1)))

        (setq i (1+ i))) )))




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-28 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28 19:07 Computations on indices Heime

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.