Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4782

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

From Andrzej Kozlowski <akoz@mimuw.edu.pl>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Quit versus Clear["Global`*"]
Date 2011-09-06 08:03 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j44k44$947$1@smc.vnet.net> (permalink)
References <201109042206.SAA21533@smc.vnet.net> <201109051106.HAA28367@smc.vnet.net> <6FE1FC74-B23C-43BE-B096-B06C93921242@mimuw.edu.pl> <op.v1cjkoz1tgfoz2@bobbys-imac.local>

Show all headers | View raw


Well, I see it differently. All Mathematica functions have the form 
Head[arguments] where the number of arguments could be 0. Quit is 
therefore a Mathematica function, like Print[], Return[]. In fact, 
Quit[n] where n is an integer also works "passing the integer n as an 
exit code to the operating system" whatever that means. On the other 
hand, expressions of the form Abracadabra are normally just symbols and 
normally they do not perform any actions. In fact, do you know of any 
other example (except Quit) when when evaluating a symbols actually does 
more than return a value (that usually happens in the case of global 
constants, whose names begin with $,

[1]:= $Version

Out[1]= 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)

Note, by the way, that Abort[] works but Abort does not:

In[3]:= Print[a];Abort[];Print[b]
During evaluation of In[3]:= a
Out[3]= $Aborted

Print[a];Abort;Print[b]
a
b

Andrzej Kozlowski




On 5 Sep 2011, at 19:44, DrMajorBob wrote:

> I, on the other hand, never saw Quit[] until this thread began.
>
> I suppose it figures that if Quit kills the kernel, then also Quit[any 
arguments or none] might also kill the kernel. (The other way 'round 
doesn't necessarily "figure", on the other hand.)
>
> Bobby
>
> On Mon, 05 Sep 2011 07:44:17 -0500, Andrzej Kozlowski 
<akoz@mimuw.edu.pl> wrote:
>
>> Actually (as far as I can tell) Quit is undocumented but Quit[] is:
>>
>> ?Quit
>> Quit[] terminates a Mathematica kernel session.
>>
>> I thought you had made a mistake but I tired just Quit (without the 
brackets) and was surprised (after all these years!) to see it work. I 
am wondering if there are more cases like this?
>>
>> Andrzej Kozlowski
>>
>> On 5 Sep 2011, at 13:06, DrMajorBob wrote:
>>
>>> No. For that, you need:
>>>
>>> Quit
>>>
>>> Bobby
>>>
>>> On Sun, 04 Sep 2011 17:06:32 -0500, Themis Matsoukas 
<tmatsoukas@me.com>
>>> wrote:
>>>
>>>> So, if I use ClearAll["Global`*"] at the beginning of a notebook 
and
>>>> execute all the cells, is it the same as running on a fresh kernel?
>>>>
>>>> Themis
>>>>
>>>
>>>
>>> --
>>> DrMajorBob@yahoo.com
>>>
>>
>
>
> --
> DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Quit versus Clear["Global`*"] Andrzej Kozlowski <akoz@mimuw.edu.pl> - 2011-09-06 08:03 +0000

csiph-web