J?rome Laurens wrote:
> Hi list,
>
> Given a counter that takes integer values 1 or 2...,
> how can I create symbol named foo1 or foo2, ...
> based on the value of the counter
>
> foo[1], foo[2] is forbidden
>
> I tried the lisp side of maxima but my actual knowledge in Lisp is near 0.
> Still experimenting.
>
> TIA
>
> Jerome
>From the lisp side i have this code snippet which i have tested as working:
(incf index)
;; Introduce variables z0, z1, etc. to represent f, f', etc.
(setq newvar (intern (concatenate 'string "z" (write-to-string index))))
(push newvar var-list)
The relevant line is the third one, note one has to represent the prefix and
the index as strings and then one can concatenate them. After that one creates
a lisp symbol by "intern".
--
Michel Talon