Re: Re: Re: Re: Bug Report - Two numerical values for a same variable

*To*: mathgroup at smc.vnet.net*Subject*: [mg54393] Re: [mg54353] Re: [mg54322] Re: Re: Bug Report - Two numerical values for a same variable*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>*Date*: Sun, 20 Feb 2005 00:07:52 -0500 (EST)*References*: <00ed01c512b0$2f242850$6400a8c0@Main> <curpbn$r28$1@smc.vnet.net> <200502150438.XAA29728@smc.vnet.net> <cv0953$jbg$1@smc.vnet.net> <200502171530.KAA02364@smc.vnet.net> <200502190731.CAA06026@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

To me at least the situation seems perfectly logical and natural. All Mathematica expressions have a well known universal structure. Functions such as Head, Part,Depth, Level etc refer to this structure. The concept of "Atom" in Mathematica refers only to this structure and to nothing else. Operations like Denominator, StringTake etc. are not universal but valid only for certain types of expressions and have no relation to this universal structure. Mathematica's "Atoms" basically correspond to "types" in other programming languages. The words"Atom" just like "type" is intended to help memory and intuition, it does not have to capture all the meaning of the word "Atom" or "type" in other contexts. Andrzej Kozlowski On 19 Feb 2005, at 08:31, Murray Eisenberg wrote: > Right. And one can use something like > > StringTake["HelloWorld", {6}] > > to extract part of the "atom" that is the string there. (This is in > contrast, say, to taking Floor[3.14] which is clearly applying an > "operation" to the atome 3.14.) > > So that's why I originally said I wasn't too sure why strings were > atoms, either. > > Steve Luttrell wrote: >> I am also uneasy about Complex and Rational being atomic. The only >> reason I >> can think of is that computational efficiency might prefer these to be >> atomic objects. >> >> You can do the following to extract the parts of a Rational: >> >> Numerator[Rational[1, 2]] >> >> Denominator[Rational[1, 2]] >> >> Analogously, Re and Im can be used to extract the "parts" of a >> Complex. >> >> Steve Luttrell >> >> "Murray Eisenberg" <murray at math.umass.edu> wrote in message >> news:cv0953$jbg$1 at smc.vnet.net... >> >>> The manipulations below are precisely what's so confusing about >>> Rational >>> objects (and Complex objects) being atoms. If >>> >>> 1/2 /. Rational[x_, 2] -> Rational[x, 7] >>> >>> works, then why not the following? >>> >>> Part[Rational[1, 2], 2] >>> >>> I can "believe" that integers and reals (and maybe strings) are >>> atoms; >>> but believing that rationals and complex numbers are atoms is a hard >>> thing to swallow! >>> >>> This has always bothered me -- and hence given me trouble trying to, >>> um, >>> rationalize this to students when I've taught Mathematica. >>> >>> >>> Scott Hemphill wrote: >>> >>>> DrBob <drbob at bigfoot.com> writes: >>>> >>>> >>>> >>>>> That explains it, but only in the sense that "things fall down" is >>>>> a >>>>> theory of gravity. Why should Rationals be atomic, for goodness >>>>> sake? And >>>>> how did I use Mathematica all this time without hearing about it? >>>>> >>>>> Sigh... >>>> >>>> >>>> >>>> In[1]:= FullForm[1/2] >>>> >>>> Out[1]//FullForm= Rational[1, 2] >>>> >>>> In[2]:= 1/2 /. Rational[x_,2] -> Rational[x,7] >>>> >>>> 1 >>>> Out[2]= - >>>> 7 >>>> >>>> Scott >>> >>> -- >>> Murray Eisenberg murray at math.umass.edu >>> Mathematics & Statistics Dept. >>> Lederle Graduate Research Tower phone 413 549-1020 (H) >>> University of Massachusetts 413 545-2859 (W) >>> 710 North Pleasant Street fax 413 545-1801 >>> Amherst, MA 01003-9305 >>> >> >> >> >> > > -- > Murray Eisenberg murray at math.umass.edu > Mathematics & Statistics Dept. > Lederle Graduate Research Tower phone 413 549-1020 (H) > University of Massachusetts 413 545-2859 (W) > 710 North Pleasant Street fax 413 545-1801 > Amherst, MA 01003-9305 > >

**References**:**Re: Bug Report - Two numerical values for a same variable***From:*Scott Hemphill <hemphill@hemphills.net>

**Re: Re: Bug Report - Two numerical values for a same variable***From:*"Steve Luttrell" <steve_usenet@_removemefirst_luttrell.org.uk>

**Re: Re: Re: Bug Report - Two numerical values for a same variable***From:*Murray Eisenberg <murray@math.umass.edu>

**Re: Controlling program flow across cells**

**Re: Bug Report - Two numerical values for a same variable**

**Re: Re: Re: Bug Report - Two numerical values for a same variable**

**Re: Bug Report - Two numerical values for a same variable**