Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: a strange line of code

  • To: mathgroup at
  • Subject: [mg52737] Re: [mg52710] a strange line of code
  • From: "Caffa Vittorio Dr." <Caffa at>
  • Date: Sat, 11 Dec 2004 05:21:53 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Try this:

In[1]:= f[x]

Out[1]= f[x]

In[2]:= f@x

Out[2]= f[x]

In[3]:= x//f

Out[3]= f[x]

In[4]:= ?#
# represents the first argument supplied to a pure function. #n
represents the nth argument.

In[5]:= ?&
Function[body] or body& is a pure function. The formal parameters are #
(or #1), #2, etc. Function[x, body] is a pure function with a single
formal parameter x. Function[{x1, x2, ... }, body] is a pure function
with a list of formal parameters.

Cheers, Vittorio

-----Original Message-----
From: Stefan Schuster
To: mathgroup at
[mailto:bi1169*delete_from_star_to_star* at] 
Subject: [mg52737] [mg52710] a strange line of code


in a notebook, I found and function to calculate the Feigenbaum 
bifurcation Diagram.
I principial understand the Feigenbaum, and I think I'm also able to 
write such an funcion by myself, but not in this compact way.

Can someone please explain me the meaning of the Symbols #, @ and &

Here is the Code:

Feigenbaum = Compile[{{
     ?, _Real}}, ({?, #} &) /@ Union[Drop[NestList[
       ? # (1 - #) &, 0.2, 300], 100]]];

thanks in advance


  • Prev by Date: Re: Linear Programming
  • Next by Date: Re: [Splines] Defining piecewise functions over a variable number of intervals
  • Previous by thread: Re: a strange line of code
  • Next by thread: Re: a strange line of code