Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Re: Programming style: postfix/prefix vs. functional

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70646] Re: [mg70633] Re: [mg70587] Programming style: postfix/prefix vs. functional
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Sun, 22 Oct 2006 01:19:20 -0400 (EDT)

On 21 Oct 2006, at 18:14, Chris Chiasson wrote:

> One thing I have wondered is, what function corresponds to the short
> hand "@". I know @ appears in Operate. Also, the ? can sometimes tell
> what function an operator represents (try ?/@ ) , but ?@ only gives
> System`$ (the symbol $ in the context System).

That's because the symbol @ already has another meaning as a "wild  
card":

@ , one or more characters excluding upperâ??case letters

(A more general wild card is, of course *). So ?@ returns all the  
symbols defined in the  contexts  of the current session that do not  
contain capital letters. Evaluate some symbols whose names contain  
only small letter in Mathematica and try ?@ again to see this in action.

Andrzej Kozlowski


>
>
> On 10/20/06, Will Robertson <wspr81 at gmail.com> wrote:
>> Hello,
>>
>> As a newcomer to Mathematica, I'm a little unsure on what "good  
>> style"
>> would be in this programming language. I notice that several  
>> functions
>> have prefix and postfix notations such as //. for ReplaceRepeated, /@
>> for Map, and so on.
>>
>> Clearly using these forms makes the code more compact, but sacrifices
>> some level of readability. Are there guidelines or suggestions that
>> have built up over the years of whether these are "good" or "bad" to
>> use?
>>
>> If it's simply personal preference, what do you like to use?
>> --
>> Many thanks,
>> Will Robertson
>>
>>
>
>
> -- 
> http://chris.chiasson.name/
>


  • Prev by Date: Re: correction
  • Next by Date: Re: Re: Programming style: postfix/prefix vs. functional
  • Previous by thread: Re: Programming style: postfix/prefix vs. functional
  • Next by thread: RE: Re: Re: Programming style: postfix/prefix vs. functional