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


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

Re: Mathematica and Lisp

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Mathematica and Lisp
Date 2013-03-04 03:57 +0000
Message-ID <kh163a$s9n$1@smc.vnet.net> (permalink)
References <kgse4s$jam$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


"@@@ ?"

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
>
>
>
>
>
>>
>
>

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


Thread

Re: Mathematica and Lisp Bill Rowe <readnews@sbcglobal.net> - 2013-03-02 08:44 +0000
  Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-03-03 07:21 +0000
    Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-03-04 03:58 +0000
      Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-03-05 09:15 +0000
    Re: Mathematica and Lisp Vince Virgilio <blueschi@gmail.com> - 2013-03-06 03:12 +0000
  Re: Mathematica and Lisp Bob Hanlon <hanlonr357@gmail.com> - 2013-03-04 03:57 +0000
  Re: Mathematica and Lisp Richard Fateman <fateman@eecs.berkeley.edu> - 2013-03-04 03:57 +0000
    Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-03-05 09:16 +0000
      Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-03-06 03:13 +0000
        Re: Mathematica and Lisp David Bailey <dave@removedbailey.co.uk> - 2013-03-06 11:04 +0000
          Re: Mathematica and Lisp Richard Fateman <fateman@cs.berkeley.edu> - 2013-03-07 08:58 +0000
  Re: Mathematica and Lisp Richard Fateman <fateman@eecs.berkeley.edu> - 2013-03-05 09:15 +0000
  Re: Mathematica and Lisp Murray Eisenberg <murray@math.umass.edu> - 2013-03-05 09:16 +0000
  Re: Mathematica and Lisp John Doty <noqsiaerospace@gmail.com> - 2013-03-07 08:58 +0000

csiph-web