Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Mathematica and Lisp
Replies: 83   Last Post: Mar 5, 2013 10:12 PM

 Messages: [ Previous | Next ]
 Bob Hanlon Posts: 906 Registered: 10/29/11
Re: Mathematica and Lisp
Posted: Mar 3, 2013 10:57 PM

"@@@ ?"

The operator @@@ has been used and explained multiple times on this
newsgroup and is documented in the Mathematica help.

Select @@@ then hit function key F1 and the search results includes a
link to the help page for the Apply function. The summary under the
link for Apply includes "f @@@ expr replaces heads at level 1 of expr
by f." Looking under Details and Options on the Apply help page is
the statement "f@@@expr is equivalent to Apply[f, expr, {1}]". For
example,

data = Array[a, {3, 2}]

{{a[1, 1], a[1, 2]}, {a[2, 1], a[2, 2]}, {a[3, 1], a[3, 2]}}

f @@@ data

{f[a[1, 1], a[1, 2]], f[a[2, 1], a[2, 2]], f[a[3, 1], a[3, 2]]}

f @@@ data == (f @@ # & /@ data) ==
Apply[f, data, 1] == Apply[f, data, {1}]

True

Bob Hanlon

On Sun, Mar 3, 2013 at 2:22 AM, Richard Fateman <fateman@cs.berkeley.edu> wrote:
> On 3/2/2013 12:44 AM, Bill Rowe wrote:
> ...
>
> <snip>
> I mostly agree with you!
>

>>
>> I agree Mathematica is different in a great many ways. And I can
>> see how someone experienced in say C or another language would
>> see Mathematica as strange and unusual. But I really don't see
>> the problem of understanding Mathematica symbols, precedence
>> etc. as being any different than learning pointers are other
>> aspects of C. It is simply a matter of study and using
>> Mathematica just as it is a case of study and using C to learn
>> pointers etc.
>>

>
> C is not my favorite programming language .. see
> www.cs.berkeley.edu/~fateman/papers/software.pdf
>
> Nevertheless one can almost argue that if you know about
> how computers work on the assembly language level you have
> a modest chance of mapping C constructs to assembler-like
> code "in your head". I've taught this as part of an
> undergraduate course in "Machine Structures".
>
> For EF, the number of unfamiliar operators and the
> number of distinct precedences is substantial.
>
> There is a table in the virtual book documentation "operation precedence"
> in the section Operator Input Forms.
>
> There are roughly
> 69 different precedence categories listed.
>
> In some precedence classes there are many forms.
> For example in the category 4th from the bottom there are these
> operators which, being in the same class, would be parsed from
> left to right (or is it right to left?) anyway, here they are.
>
> =, :=, ^=, ^:=, =. ->,
> and also the matchfix
> /: =
> /: :=
>
> While some of the operators have no built-in meaning, and some are
> pretty obscure, they are all part of the syntax. There are also quite
> a few multi-character operators, some of which are new to me.. @@@ ?
>
> This is an attempt to document one of reasons I think EF is NOT just
> as easy to learn as any other language. I've previous mentioned other
> reasons which can be grouped generally under the category "semantics".
>
> RJF
>
>
>
>
>

>>
>
>

Date Subject Author
1/11/13 amzoti
1/12/13 Richard Fateman
1/12/13 David Bailey
1/14/13 Richard Fateman
1/14/13 David Bailey
1/16/13 Richard Fateman
1/18/13 David Bailey
1/22/13 Richard Fateman
1/22/13 David Bailey
1/24/13 Richard Fateman
1/25/13 Richard Fateman
1/26/13 Murray Eisenberg
1/26/13 Murray Eisenberg
1/26/13 W. Craig Carter
1/16/13 Murray Eisenberg
1/16/13 Richard Fateman
1/16/13 David Bailey
1/18/13 Murray Eisenberg
1/31/13 Noqsi
2/2/13 Daniel Lichtblau
2/3/13 Richard Fateman
2/2/13 Richard Fateman
2/3/13 David Bailey
2/5/13 Richard Fateman
2/6/13 David Bailey
2/6/13 Richard Fateman
2/3/13 Andrzej Kozlowski
2/5/13 Richard Fateman
2/6/13 David Bailey
2/5/13 Bill Rowe
2/6/13 Joseph Gwinn
2/3/13 Matthias Bode
2/3/13 Noqsi
2/6/13 Richard Fateman
2/6/13 David Bailey
2/6/13 mathgroup
2/4/13 Alex Krasnov
2/6/13 Noqsi
2/8/13 Richard Fateman
2/9/13 János Löbb
2/9/13 Richard Fateman
2/10/13 michael
2/10/13 Bill Rowe
2/8/13 Andrzej Kozlowski
2/8/13 Noqsi
2/9/13 Richard Fateman
2/10/13 David Bailey
2/9/13 Matthias Bode
2/15/13 Noqsi
2/17/13 David Bailey
2/18/13 Joseph Gwinn
2/18/13 David Park
2/22/13 Richard Fateman
2/23/13 David Bailey
2/23/13 Richard Fateman
2/25/13 David Bailey
2/26/13 Richard Fateman
2/27/13 Bill Rowe
2/27/13 Richard Fateman
3/2/13 Bill Rowe
3/3/13 Richard Fateman
3/3/13 Noqsi
3/5/13 Richard Fateman
3/5/13 Vince Virgilio
3/3/13 Bob Hanlon
1/16/13 Noqsi
1/16/13 Richard Fateman
1/18/13 Noqsi
2/23/13 Dr. Peter Klamser
2/25/13 Richard Fateman
2/26/13 Noqsi