Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Quit versus Clear["Global`*"]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg121226] Re: Quit versus Clear["Global`*"]
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Mon, 5 Sep 2011 07:05:58 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201109031205.IAA05310@smc.vnet.net> <j3u7r6$a88$1@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

Your experiment makes Remove look useful (possibly), but here's one that  
does not:

ClearAll[f]
f[x_] := Plot[x, {x, 0, 1}] SetAttributes[f, Listable]
Remove[x]
?? f

Remove[x] cripples f without mentioning it, which I'd call a very ugly  
side-effect.

Bobby

On Sun, 04 Sep 2011 17:05:26 -0500, Murray Eisenberg  
<murray at math.umass.edu> wrote:

> Try the following little three-part experiment.  In each part, the last
> step tells you what Mathematica now knows about the symbol f.
>
>     f[x_] := Plot[x, {x, 0, 1}]
>     SetAttributes[f, Listable]
>     Clear[f]
>     ??f
>
>     f[x_] := Plot[x, {x, 0, 1}]
>     SetAttributes[f, Listable]
>     ClearAll[f]
>     ??f
>
>     f[x_] := Plot[x, {x, 0, 1}]
>     SetAttributes[f, Listable]
>     Remove[f]
>     ??f
>
> On 9/4/11 4:12 AM, AES wrote:
>> In article<j3u7r6$a88$1 at smc.vnet.net>,
>>   Murray Eisenberg<murray at math.umass.edu>  wrote:
>>
>>> First, Clear, whether for a single object or an entire list of objects,
>>> does not remove their Attributes, e.g., just their values. You might
>>> want ClearAll instead.
>>
>> And how do either of those differ from Remove?
>>
>


-- 
DrMajorBob at yahoo.com




  • Prev by Date: Re: Quit versus Clear["Global`*"]
  • Next by Date: Re: Print bug with -script? (quotes display)
  • Previous by thread: Re: Quit versus Clear["Global`*"]
  • Next by thread: Re: Quit versus Clear["Global`*"]