[Date Index] [Thread Index] [Author Index]
Re: Style for function calls?
I use // when it's an afterthought -- a function I want to apply after everything else, especially if I'm likely to remove that step, a bit later. I use f@something when f has a single argument and "something" is simple. Cos@x, for instance, but Cos[x+1]. In both cases, I'm using fewer keystrokes than Cos[x] or Cos@(x+1). I mix operator forms to avoid deep nesting of brackets, to the point that the human eye can't tell what function is applied to what. But, by all means, do it any way you like! Bobby On Fri, 06 Mar 2009 03:25:57 -0600, Erik Max Francis <max at alcyone.com> wrote: > I'm fairly new to Mathematica and have a style question rather than a > functionality question. > > I'm aware with the operator forms for Postfix (//), Prefix (@), and > Infix (~), and I've found the // operator useful for piping long results > through the ...Form functions, or N, or the like, as a quick > afterthought while typing a lot of stuff. > > What are the analogous situations where @ or ~ are used? Looking at > random notebooks around I've from time to time seen them used but there > doesn't seem to be any rhyme or reason; it's not clear when > stylistically they'd be useful, as opposed to the // operator, which I > can see and use myself. > -- DrMajorBob at bigfoot.com