How to kill the content of a list instead of the list itself?
Subject: How to kill the content of a list instead of the list itself?
From: Stefano Ferri
Date: Wed, 29 Dec 2010 18:17:04 +0100
>
> 'mylist;
>> [a,b,c]
>>
>
> NO! 'mylist here evaluates to the symbol mylist.
>
> 'mylist;
>> [a,b,c]
>>
>
> WRONG!
>
>
Ooops... I'm sorry for that, this is what happens when writing with hurry
and without using Maxima... I have written that commands directly in the
email body... Of course, that 'mylist is nonsense.
I was asking the question because, as Richard Fateman guessed, I have to
repeatedly kill some variables to avoid problems, each time I load a .mac
file to perform some computations.
Since I would like to keep the syntax as simple as possible, I will define a
list of variables to be killed in the form
varlist : '[var1, var2,....]
this list is quite long, so it is better to write
apply(kill,varlist)
at the beginning of each computation.
Thank you all for your replies.
Stefano