Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Whitespace weirdness.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg74340] Whitespace weirdness.
  • From: "wooks" <wookiz at hotmail.com>
  • Date: Mon, 19 Mar 2007 02:02:41 -0500 (EST)

Clear[Eternity,x];
Eternity[x_]:=Eternity[x];

Clear[EmptyQ];
EmptyQ[{}] := True;
EmptyQ[x_List] := False;
EmptyQ[x_] := Print["Argument to EmptyQ must be a list."];

Clear[length,list,f,g]
Function[f,
    Function[list,If[EmptyQ[list],0,
                                            1+f[Rest[list]]]]]
[Function[g,
 
Function[list,If[EmptyQ[list], 0,
                                                                1 +
g[Rest[list]]]]][Eternity]]

Clear[length,list,f,g]
Function[f,
  Function[list,If[EmptyQ[list],0,
                                          1+f[Rest[list]]]]]
[Function[g,Function[list,If[EmptyQ[list], 0,
                                                                1 +
g[Rest[list]]]]][Eternity]]

 Here are 2 versions of the same anonymous function. The only
difference between them is that in the second version Function[g....
starts on a new line.

One of them works. The other generates a syntax error.



  • Prev by Date: Re: Keyboard shortcut to select the entire cell
  • Next by Date: Normal for Limit : Example
  • Previous by thread: Re: Boundary Conditions in PDE
  • Next by thread: Re: Whitespace weirdness.