Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #8944
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: new functional operator |
| Date | 2012-03-10 11:16 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jjfd6e$7u7$1@smc.vnet.net> (permalink) |
On 3/9/12 at 6:09 AM, roby.nowak@gmail.com (roby) wrote:
>Ok, next version.
>One can look for an prefix operator with no buit in meaning to
>modify the function in question such that it acts mapping, this way
>we can use the standard // postfix operator and just modify the
>behavoir of the function:
>\[Del] fn_ := fn /@ # &
>{1,2,3,4}//\[Del]f//\[Del]g
>Out[5]= {g[f[1]], g[f[2]], g[f[3]], g[f[4]]}
>(looks all nice in a Notebook)
I don't have any problem agreeing this notation looks nicer than say
{1, 2, 3, 4} // f /@ # & // g /@ # &
And, I can set up the definition in init.m so that it is always
available without needing to define it in each notebook where I
would use it.
But it presents another issue. Unless you are writing code for
yourself you will never share with someone else, you will be
making your code much more difficult to understand.
Arguably something like
f/@{1,2,3,4}
is already opaque to a new Mathematica user in terms of
understanding code. But, since this is standard syntax one could
highlight the /@ then use the built-in documentation to
determine what the code is doing. But once you start using
custom notation, this ability is lost. Then, even a well
seasoned user will have great difficulty in determining what the
code does.
And in fact, unless you use such custom notation often, you are
likely to have difficulty with your own code if you need to
review/modify it say a year or two after it was written.
Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread
Re: new functional operator Bill Rowe <readnews@sbcglobal.net> - 2012-03-10 11:16 +0000
Re: new functional operator roby <roby.nowak@gmail.com> - 2012-03-14 05:34 +0000
Re: new functional operator John Doty <noqsiaerospace@gmail.com> - 2012-03-18 07:43 +0000
Re: new functional operator roby <roby.nowak@gmail.com> - 2012-03-20 07:19 +0000
Re: new functional operator John Doty <noqsiaerospace@gmail.com> - 2012-03-21 10:47 +0000
Re: new functional operator DrMajorBob <btreat1@austin.rr.com> - 2012-03-21 10:48 +0000
Re: new functional operator roby <roby.nowak@gmail.com> - 2012-03-22 10:51 +0000
Re: new functional operator Barrie Stokes <Barrie.Stokes@newcastle.edu.au> - 2012-03-22 10:54 +0000
Re: new functional operator roby <roby.nowak@gmail.com> - 2012-03-23 06:33 +0000
Re: new functional operator DrMajorBob <btreat1@austin.rr.com> - 2012-03-24 07:05 +0000
Re: new functional operator Ray Koopman <koopman@sfu.ca> - 2012-03-25 05:15 +0000
Re: new functional operator Barrie Stokes <Barrie.Stokes@newcastle.edu.au> - 2012-03-26 06:51 +0000
Re: new functional operator roby <roby.nowak@gmail.com> - 2012-03-28 09:57 +0000
csiph-web