Most of the times there is no need to write manually many variables with the same name and a different index, like
var0, var1, var2, var3, ..., var9
because one can use arrays, vectors or whatever the language offers.
Anyway, I just needed to write manually ten variables as shown above. What is the fastest way to do it with emacs?
I guess that the fastest way is to write some elisp code. I tried doing it with this code
(setq i 0)
(while (< i 10) (print (format "var%d, " i)) (setq i (+ 1 i))
followed by (insert-last-message)
defined here.
It does not work (I get "(#o0, #x0, ?\C-@)").
What's wrong here? Is there any faster way?