[Maxima] dynamically created symbol

Richard Fateman fateman at eecs.berkeley.edu
Thu Jun 28 17:52:09 CDT 2012


While there are possible uses for contexts, are you sure you really need 
them?
Or are you using contexts instead of simple bindings of variables?

You can do this:

foo[i]:= concat(foo,i);

apply(supcontext, [foo[3]])

etc.


On 6/28/2012 12:41 PM, Jérome Laurens wrote:
> Le 28 juin 2012 à 16:46, Robert Dodier a écrit :
>
>> On 2012-06-28, Jérome Laurens <jerome.laurens at u-bourgogne.fr> wrote:
>>
>>> 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
>> Usually the "better way" to do that is to use subscripted variables.
>> So, why is foo[k] forbidden?
> supcontext only accepts symbols and complains when fed with a subscripted variable
>
> Jerome
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima




More information about the Maxima mailing list