MathGroup Archive 2007

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

Search the Archive

Re: annoying documentation in 6 (rant)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79289] Re: annoying documentation in 6 (rant)
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Mon, 23 Jul 2007 03:49:53 -0400 (EDT)
  • Organization: Customer of PlusNet plc (http://www.plus.net)
  • References: <f77j9r$c9p$1@smc.vnet.net> <19356212.1184479716385.JavaMail.root@m35> <f7f34s$od7$1@smc.vnet.net> <200707170728.DAA27254@smc.vnet.net> <f7ke30$4m5$1@smc.vnet.net> <200707190731.DAA01595@smc.vnet.net> <f7pp6e$q8h$1@smc.vnet.net>

Murray Eisenberg wrote:
> How did you discover the function Precedence?  I tried searching for it 
> in the Documentation Center and I got a set of 11 pages none of whose 
> items, so far as I can see, includes that function.  Moreover, 
> evaluating "?Precedence" in a notebook just tells one that Precedence is 
> in context System and is Protected -- nothing more and no link to a 
> reference page!
> 
> Moreover, exactly what do the values of Precedence indicate?  For example,
> 
>    Precedence[Apply]
>    Precedence[Map]
> 620
> 620
> 
> This doesn't say what Mathematica does if there's an Apply and a Map in 
> an expression. And in any case, Precedence is of no use in trying to 
> handle a special input form such as @@ or /@ -- which is the real issue! 
> -- since Precedence signals a Syntax error in such cases.
> 
> David Bailey wrote:
>> Murray Eisenberg wrote:
>>> Here's another shortcoming of the 6.0 Documentation Center organization 
>>> (or lack thereof).
>>>
>>> When one uses special input forms (abbreviations), such as = and := and 
>>> /. and @ and @@ and @@@ and /@, what is the order of precedence and what 
>>> is the grouping when a single form appears several times in a row?
>>>
>>> In The Mathematica Book this was answered in an obvious place, namely, 
>>> Section A.2, "Input Syntax", of the Appendix "Mathematica Reference Guide".
>>>
>>> Where is it in the Version 6.0 Documentation Center?  After some 
>>> considerable searching I found it in tutorial/InputSyntax.
>>>
>>> But at this point I cannot even reconstruct how I found it!  I tried 
>>> searching on "precedence" and "order of precedence".  The first turns up 
>>> nothing obviously useful. The second gave as the tenth entry "The Syntax 
>>> of the Mathematica Language", which is a tutorial.  And roughly a third 
>>> to a half-way down in that tutorial says,
>>>
>>>    The table in "Operator Input Forms" gives the complete
>>>    ordering by precedence of all operators in Mathematica.
>>>
>>> The phrase 'Operator Input Forms' there has a link, finally, to the 
>>> correct place in the tutorial (!!) InputSyntax.
>>>
>>> Another possible route to the same thing is from the home page of the 
>>> Documentation Center, at the item "Syntax" in the first box "Core 
>>> Language".  The target is guide/Syntax.  In that guide, near the bottom 
>>> of the page, under "Tutorials", is a link to the aforementioned tutorial 
>>> "The Syntax of the Mathematica Language" (which then requires spotting 
>>> the further link to the relevant material). And in guide/Syntax there's 
>>> another tutorial link, "Input Syntax", whose target is the desired 
>>> end-point tutorial/InputSyntax.
>>>
>>> Such are the ways of the 6.0 Documentation Center -- and some of the 
>>> intricacies and limitations of combining expository and tutorial 
>>> presentations with reference materials.
>>>
>>> In the case at hand, I got there eventually.  But after I did I felt 
>>> like it shouldn't be so hard.  (Maybe the younger generations are more 
>>> adept or more patient at negotiating searches than I!)
>>>
>>> So: The more I use the Documentation Center, the more I like it and, 
>>> at the same time, the more I miss The Mathematica Book (whether printed 
>>> or electronic).
>>>
>>> David Bailey wrote:
>>>
>>>> Seriously, though, without a book for 6.0, the help topics absolutely 
>>>> must be authoritative and complete. 
>> Murray,
>>
>> I certainly agree - that table is very useful, but you can get at least 
>> part of that information by using Precedence, e.g.:
>>
>> Precedence[Times]
>>
>> However, I don't know a function to get the associativity of the operators.
>>
>> David Bailey
>> http://www.dbaileyconsultancy.co.uk
>>
> 
I knew about Precedence for many years - it goes back a long way!

Even though you apply Precedence to the name of the function, the result 
of Precedence relates to the operator form - such as @@ - not to the 
function form, where the concept of precedence does not apply.

In the case where the precedence of two operators is equal, the 
associativity acts as the decider, and as I said, that information does 
not seem to be available programatically. However, it is possible to get 
the information directly by executing:

Hold[a /@ b @@ c] // FullForm

and

Hold[a @@ b /@ c] // FullForm

Of course, none of this invalidates the more general point, that all 
this information should be easily accessible from the help system.

In this internet connected age, it might be an idea if you could push a 
button if a query failed to generate anything useful, and the query 
would go to the person at WRI that manages the documentation center to 
help improve future versions.

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: Re: Wolfram Workbench 1.1 now available
  • Next by Date: Re: Re: Wolfram Workbench 1.1 now available
  • Previous by thread: Re: Re: annoying documentation in 6 (rant)
  • Next by thread: Re: Re: Re: annoying documentation in 6 (rant)