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: pietru
Subject: Re: Passing a list to an interactive function
Date: Sat, 19 Dec 2020 12:03:58 +0100

Yes, that was the problem, the counting from 1.

> Sent: Saturday, December 19, 2020 at 11:24 AM
> From: "Jean Louis" <bugs@gnu.support>
> To: pietru@caramail.com
> Cc: "Help Gnu Emacs" <help-gnu-emacs@gnu.org>
> Subject: Re: Passing a list to an interactive function
>
> * 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]