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

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

Re: Passing a list to an interactive function


From: Jean Louis
Subject: Re: Passing a list to an interactive function
Date: Sat, 19 Dec 2020 08:54:19 +0300
User-agent: Mutt/2.0 (3d08634) (2020-11-07)

* pietru@caramail.com <pietru@caramail.com> [2020-12-19 07:30]:
> Am trying to fill variables "ta tb tc" with the numbers from "tlist"
> 
(defun thermoluminesce (tseq)
  "Sets thermoluminesce."
  (interactive "stseq: ")
  (message "stseq: %s " tseq)
  (let  ((slist (split-string tseq))
         tlist ta tb tpab)
    (message "slist: %s" slist)
    (message "tlist: %s" tlist)
    (message "tlen: %d" (length tlist))
    (setq tlist (mapcar #'string-to-number slist))
    ;;(setq ta (nth 1 tlist))
    ;;(setq tb (nth 2 tlist))
    (setq tc (nth 3 tlist))
    (message "ta tb tc: %d %d %d" ta tb tc) ))

You could as well teach us here what those variables mean by giving
them better descriptive names.

(nth 2 '(1 2 3)) => 3

Is maybe that the problem? That nth is counting starting from 0, not from 1.




reply via email to

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